Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+4 -4
+1 -1
arch/powerpc/kernel/eeh.c
··· 1472 1472 if (!dev) 1473 1473 return 0; 1474 1474 1475 - if (dev->iommu_group) { 1475 + if (device_iommu_mapped(dev)) { 1476 1476 *ppdev = pdev; 1477 1477 return 1; 1478 1478 }
+3 -3
arch/powerpc/kernel/iommu.c
··· 1086 1086 if (!device_is_registered(dev)) 1087 1087 return -ENOENT; 1088 1088 1089 - if (dev->iommu_group) { 1089 + if (device_iommu_mapped(dev)) { 1090 1090 pr_debug("%s: Skipping device %s with iommu group %d\n", 1091 1091 __func__, dev_name(dev), 1092 1092 iommu_group_id(dev->iommu_group)); ··· 1129 1129 * and we needn't detach them from the associated 1130 1130 * IOMMU groups 1131 1131 */ 1132 - if (!dev->iommu_group) { 1132 + if (!device_iommu_mapped(dev)) { 1133 1133 pr_debug("iommu_tce: skipping device %s with no tbl\n", 1134 1134 dev_name(dev)); 1135 1135 return; ··· 1148 1148 case BUS_NOTIFY_ADD_DEVICE: 1149 1149 return iommu_add_device(dev); 1150 1150 case BUS_NOTIFY_DEL_DEVICE: 1151 - if (dev->iommu_group) 1151 + if (device_iommu_mapped(dev)) 1152 1152 iommu_del_device(dev); 1153 1153 return 0; 1154 1154 default: