drm/exynos: using dev_get_drvdata directly
authorFuqian Huang <huangfq.daxian@gmail.com>
Thu, 4 Jul 2019 02:34:36 +0000 (10:34 +0800)
committerInki Dae <inki.dae@samsung.com>
Fri, 2 Aug 2019 06:28:47 +0000 (15:28 +0900)
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>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_fimc.c
drivers/gpu/drm/exynos/exynos_drm_gsc.c

index a594ab7be2c055f0861b00c6052aa82cf8b09499..164d914cbe9a49a437dedb86e5c5214ac645f0a5 100644 (file)
@@ -44,7 +44,7 @@ static unsigned int fimc_mask = 0xc;
 module_param_named(fimc_devs, fimc_mask, uint, 0644);
 MODULE_PARM_DESC(fimc_devs, "Alias mask for assigning FIMC devices to Exynos DRM");
 
-#define get_fimc_context(dev)  platform_get_drvdata(to_platform_device(dev))
+#define get_fimc_context(dev)  dev_get_drvdata(dev)
 
 enum {
        FIMC_CLK_LCLK,
index 1e4b21c49a06fd86b520012a0079f04be5d2e8c1..1c524db9570f8734ce508c868b4975080c4d4fd9 100644 (file)
@@ -58,7 +58,7 @@
 #define GSC_COEF_DEPTH 3
 #define GSC_AUTOSUSPEND_DELAY          2000
 
-#define get_gsc_context(dev)   platform_get_drvdata(to_platform_device(dev))
+#define get_gsc_context(dev)   dev_get_drvdata(dev)
 #define gsc_read(offset)               readl(ctx->regs + (offset))
 #define gsc_write(cfg, offset) writel(cfg, ctx->regs + (offset))