summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mcde/mcde_drv.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2020-04-15 10:40:04 +0300
committerDaniel Vetter <daniel.vetter@ffwll.ch>2020-04-28 17:03:40 +0300
commitfd7ee85cfe7bad518da9dd17dd6ee44199e20833 (patch)
tree4c500df54eced8a248a2626e7f4e22e289e922e0 /drivers/gpu/drm/mcde/mcde_drv.c
parent6ff71edfcb0be37c803da51e1b893809ead22203 (diff)
downloadlinux-fd7ee85cfe7bad518da9dd17dd6ee44199e20833.tar.xz
drm/mcde: Don't use drm_device->dev_private
Upcasting using a container_of macro is more typesafe, faster and easier for the compiler to optimize. v2: Move misplaced removal of double-assignment to this patch (Sam) Reviewed-by: Linus Walleij <linus.walleij@linaro.org> (v1) Acked-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-30-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/mcde/mcde_drv.c')
-rw-r--r--drivers/gpu/drm/mcde/mcde_drv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c
index 22003478db2c..84f3e2dbd77b 100644
--- a/drivers/gpu/drm/mcde/mcde_drv.c
+++ b/drivers/gpu/drm/mcde/mcde_drv.c
@@ -164,7 +164,7 @@ static irqreturn_t mcde_irq(int irq, void *data)
static int mcde_modeset_init(struct drm_device *drm)
{
struct drm_mode_config *mode_config;
- struct mcde *mcde = drm->dev_private;
+ struct mcde *mcde = to_mcde(drm);
int ret;
if (!mcde->bridge) {
@@ -311,13 +311,11 @@ static int mcde_probe(struct platform_device *pdev)
if (IS_ERR(mcde))
return PTR_ERR(mcde);
drm = &mcde->drm;
- drm->dev_private = mcde;
mcde->dev = dev;
platform_set_drvdata(pdev, drm);
/* Enable continuous updates: this is what Linux' framebuffer expects */
mcde->oneshot_mode = false;
- drm->dev_private = mcde;
/* First obtain and turn on the main power */
mcde->epod = devm_regulator_get(dev, "epod");
@@ -487,7 +485,7 @@ regulator_epod_off:
static int mcde_remove(struct platform_device *pdev)
{
struct drm_device *drm = platform_get_drvdata(pdev);
- struct mcde *mcde = drm->dev_private;
+ struct mcde *mcde = to_mcde(drm);
component_master_del(&pdev->dev, &mcde_drm_comp_ops);
clk_disable_unprepare(mcde->mcde_clk);