Skip to contentSkip to conversation

iommu: using dev_get_drvdata directly

PATCH In review Fuqian Huang 2 participants 2 messages Jul 4, 2019 IOMMU

lore
Share & tools
lore
#0 lore raw

PATCH v2 6/10 iommu: using dev_get_drvdata directly

Several drivers cast a struct device pointer to a struct platform_device pointer only to then call platform_get_drvdata(). To improve readability, these constructs can be simplified by using dev_get_drvdata() directly.

---
Changes in v2:
- Make the commit message more clearly.

 drivers/iommu/omap-iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/omap-iommu.c +1 -1
index 62f9c61338a5..c638f7795735 100644
@@ -36,7 +36,7 @@
 static const struct iommu_ops omap_iommu_ops;
 
 #define to_iommu(dev)							\
-	((struct omap_iommu *)platform_get_drvdata(to_platform_device(dev)))
+	((struct omap_iommu *)dev_get_drvdata(dev))
 
 /* bitmap of the page sizes currently supported */
 #define OMAP_IOMMU_PGSIZES	(SZ_4K | SZ_64K | SZ_1M | SZ_16M)
Signature · 1 line
2.11.0
maintainer
#1 lore raw

drivers/iommu/omap-iommu.c line 39

Quoted 3 lines · Fuqian Huang

#define to_iommu(dev) \

drivers/iommu/omap-iommu.c +1 -1
-	((struct omap_iommu *)platform_get_drvdata(to_platform_device(dev)))
+	((struct omap_iommu *)dev_get_drvdata(dev))

A similar change is already queued for v5.3.
_______________________________________________
iommu mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/iommu