* [Patch v2 06/10] iommu: using dev_get_drvdata directly
@ 2019-07-04 2:36 ` Fuqian Huang
0 siblings, 0 replies; 4+ messages in thread
From: Fuqian Huang @ 2019-07-04 2:36 UTC (permalink / raw)
Cc: Joerg Roedel, iommu, linux-kernel, Fuqian Huang
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.
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
Changes in v2:
- Make the commit message more clearly.
drivers/iommu/omap-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 62f9c61338a5..c638f7795735 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -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)
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Patch v2 06/10] iommu: using dev_get_drvdata directly
@ 2019-07-04 2:36 ` Fuqian Huang
0 siblings, 0 replies; 4+ messages in thread
From: Fuqian Huang @ 2019-07-04 2:36 UTC (permalink / raw)
Cc: Fuqian Huang, iommu, linux-kernel
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.
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
---
Changes in v2:
- Make the commit message more clearly.
drivers/iommu/omap-iommu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 62f9c61338a5..c638f7795735 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -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)
--
2.11.0
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Patch v2 06/10] iommu: using dev_get_drvdata directly
2019-07-04 2:36 ` Fuqian Huang
@ 2019-07-04 8:12 ` Joerg Roedel
-1 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2019-07-04 8:12 UTC (permalink / raw)
To: Fuqian Huang; +Cc: iommu, linux-kernel
On Thu, Jul 04, 2019 at 10:36:20AM +0800, Fuqian Huang wrote:
> #define to_iommu(dev) \
> - ((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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Patch v2 06/10] iommu: using dev_get_drvdata directly
@ 2019-07-04 8:12 ` Joerg Roedel
0 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2019-07-04 8:12 UTC (permalink / raw)
To: Fuqian Huang; +Cc: iommu, linux-kernel
On Thu, Jul 04, 2019 at 10:36:20AM +0800, Fuqian Huang wrote:
> #define to_iommu(dev) \
> - ((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
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-07-04 8:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-04 2:36 [Patch v2 06/10] iommu: using dev_get_drvdata directly Fuqian Huang
2019-07-04 2:36 ` Fuqian Huang
2019-07-04 8:12 ` Joerg Roedel
2019-07-04 8:12 ` Joerg Roedel
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.