diff options
author | Joerg Roedel <jroedel@suse.de> | 2018-11-30 14:23:19 +0100 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2018-12-17 10:38:43 +0100 |
commit | bf8763d8f8376e98ea2a8e0fc4803f25ff91393e (patch) | |
tree | cee2699a489cf48073dce01171436ff0f04cdbb0 /arch/powerpc/kernel/iommu.c | |
parent | 13e6a84d697e8eb8b61a3fe55b4109a666c4851d (diff) | |
download | lwn-bf8763d8f8376e98ea2a8e0fc4803f25ff91393e.tar.gz lwn-bf8763d8f8376e98ea2a8e0fc4803f25ff91393e.zip |
powerpc/iommu: Use device_iommu_mapped()
Use the new function to replace the open-coded iommu check.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Russell Currey <ruscur@russell.cc>
Cc: Sam Bobroff <sbobroff@linux.ibm.com>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'arch/powerpc/kernel/iommu.c')
-rw-r--r-- | arch/powerpc/kernel/iommu.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index f0dc680e659a..48d58d1dcac2 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c @@ -1086,7 +1086,7 @@ int iommu_add_device(struct device *dev) if (!device_is_registered(dev)) return -ENOENT; - if (dev->iommu_group) { + if (device_iommu_mapped(dev)) { pr_debug("%s: Skipping device %s with iommu group %d\n", __func__, dev_name(dev), iommu_group_id(dev->iommu_group)); @@ -1129,7 +1129,7 @@ void iommu_del_device(struct device *dev) * and we needn't detach them from the associated * IOMMU groups */ - if (!dev->iommu_group) { + if (!device_iommu_mapped(dev)) { pr_debug("iommu_tce: skipping device %s with no tbl\n", dev_name(dev)); return; @@ -1148,7 +1148,7 @@ static int tce_iommu_bus_notifier(struct notifier_block *nb, case BUS_NOTIFY_ADD_DEVICE: return iommu_add_device(dev); case BUS_NOTIFY_DEL_DEVICE: - if (dev->iommu_group) + if (device_iommu_mapped(dev)) iommu_del_device(dev); return 0; default: |