iommu: Do not dereference fwnode in struct device
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 1 Aug 2022 16:47:58 +0000 (19:47 +0300)
committerJoerg Roedel <jroedel@suse.de>
Wed, 7 Sep 2022 08:37:28 +0000 (10:37 +0200)
In order to make the underneath API easier to change in the future,
prevent users from dereferencing fwnode from struct device.
Instead, use the specific dev_fwnode() API for that.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Link: https://lore.kernel.org/r/20220801164758.20664-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/iommu.c

index 780fb70..31b5f4c 100644 (file)
@@ -173,7 +173,7 @@ int iommu_device_register(struct iommu_device *iommu,
 
        iommu->ops = ops;
        if (hwdev)
-               iommu->fwnode = hwdev->fwnode;
+               iommu->fwnode = dev_fwnode(hwdev);
 
        spin_lock(&iommu_device_lock);
        list_add_tail(&iommu->list, &iommu_device_list);