Skip to content

Commit

Permalink
drm/exynos: using dev_get_drvdata directly
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Inki Dae <[email protected]>
  • Loading branch information
Yellow-Pay authored and daeinki committed Aug 2, 2019
1 parent f8981e0 commit 9eae7c3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_fimc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_gsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down

0 comments on commit 9eae7c3

Please sign in to comment.