]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iommu: Use Functions to set default domain type in iommu_set_def_domain_type()
authorJoerg Roedel <jroedel@suse.de>
Mon, 19 Aug 2019 13:22:48 +0000 (15:22 +0200)
committerJoerg Roedel <jroedel@suse.de>
Fri, 23 Aug 2019 08:09:58 +0000 (10:09 +0200)
There are functions now to set the default domain type which
take care of updating other necessary state. Don't open-code
it in iommu_set_def_domain_type() and use those functions
instead.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c

index c5e0fc5ffe8bb97d90dca1b965e80fe7966cf1ab..544f44fc08e4dc34e5d6c5cd4a80211102f080b8 100644 (file)
@@ -178,9 +178,11 @@ static int __init iommu_set_def_domain_type(char *str)
        if (ret)
                return ret;
 
-       iommu_set_cmd_line_dma_api();
+       if (pt)
+               iommu_set_default_passthrough(true);
+       else
+               iommu_set_default_translated(true);
 
-       iommu_def_domain_type = pt ? IOMMU_DOMAIN_IDENTITY : IOMMU_DOMAIN_DMA;
        return 0;
 }
 early_param("iommu.passthrough", iommu_set_def_domain_type);