iommu/virtio: Do not dereference fwnode in struct device
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 1 Aug 2022 16:51:42 +0000 (19:51 +0300)
committerJoerg Roedel <jroedel@suse.de>
Wed, 7 Sep 2022 08:38:22 +0000 (10:38 +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 device_match_fwnode() API for that.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Link: https://lore.kernel.org/r/20220801165142.20898-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/virtio-iommu.c

index 08eeafc9529fa0580da66a4e93fd8fb2b81fc52e..9fe723f55213fbd290a3537aecc01783e41272d9 100644 (file)
@@ -925,7 +925,7 @@ static struct virtio_driver virtio_iommu_drv;
 
 static int viommu_match_node(struct device *dev, const void *data)
 {
-       return dev->parent->fwnode == data;
+       return device_match_fwnode(dev->parent, data);
 }
 
 static struct viommu_dev *viommu_get_by_fwnode(struct fwnode_handle *fwnode)