mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
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>
This commit is contained in:
parent
13e6a84d69
commit
bf8763d8f8
2 changed files with 4 additions and 4 deletions
|
@ -1472,7 +1472,7 @@ static int dev_has_iommu_table(struct device *dev, void *data)
|
||||||
if (!dev)
|
if (!dev)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (dev->iommu_group) {
|
if (device_iommu_mapped(dev)) {
|
||||||
*ppdev = pdev;
|
*ppdev = pdev;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1086,7 +1086,7 @@ int iommu_add_device(struct device *dev)
|
||||||
if (!device_is_registered(dev))
|
if (!device_is_registered(dev))
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
if (dev->iommu_group) {
|
if (device_iommu_mapped(dev)) {
|
||||||
pr_debug("%s: Skipping device %s with iommu group %d\n",
|
pr_debug("%s: Skipping device %s with iommu group %d\n",
|
||||||
__func__, dev_name(dev),
|
__func__, dev_name(dev),
|
||||||
iommu_group_id(dev->iommu_group));
|
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
|
* and we needn't detach them from the associated
|
||||||
* IOMMU groups
|
* IOMMU groups
|
||||||
*/
|
*/
|
||||||
if (!dev->iommu_group) {
|
if (!device_iommu_mapped(dev)) {
|
||||||
pr_debug("iommu_tce: skipping device %s with no tbl\n",
|
pr_debug("iommu_tce: skipping device %s with no tbl\n",
|
||||||
dev_name(dev));
|
dev_name(dev));
|
||||||
return;
|
return;
|
||||||
|
@ -1148,7 +1148,7 @@ static int tce_iommu_bus_notifier(struct notifier_block *nb,
|
||||||
case BUS_NOTIFY_ADD_DEVICE:
|
case BUS_NOTIFY_ADD_DEVICE:
|
||||||
return iommu_add_device(dev);
|
return iommu_add_device(dev);
|
||||||
case BUS_NOTIFY_DEL_DEVICE:
|
case BUS_NOTIFY_DEL_DEVICE:
|
||||||
if (dev->iommu_group)
|
if (device_iommu_mapped(dev))
|
||||||
iommu_del_device(dev);
|
iommu_del_device(dev);
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue