]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/v3d: Don't set drm_device->dev_private
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 15 Apr 2020 07:39:42 +0000 (09:39 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 28 Apr 2020 13:15:41 +0000 (15:15 +0200)
And switch the helper over to container_of, which is a bunch faster
than chasing a pointer. Plus allows gcc to see through this maze.

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-8-daniel.vetter@ffwll.ch
drivers/gpu/drm/v3d/v3d_drv.c
drivers/gpu/drm/v3d/v3d_drv.h

index 8d0c0daaac8187a934e4e24688ca39f5de17432e..ead62a15d48f694d799a1d02b4b105ad15d3c9f5 100644 (file)
@@ -265,7 +265,6 @@ static int v3d_platform_drm_probe(struct platform_device *pdev)
        }
 
        platform_set_drvdata(pdev, drm);
-       drm->dev_private = v3d;
        drmm_add_final_kfree(drm, v3d);
 
        ret = map_regs(v3d, &v3d->hub_regs, "hub");
index e0775c884553af46c764880c52531acd3c6e3f91..112d80aed5f6f47dbe644a1d0d9d783528b2a36e 100644 (file)
@@ -121,7 +121,7 @@ struct v3d_dev {
 static inline struct v3d_dev *
 to_v3d_dev(struct drm_device *dev)
 {
-       return (struct v3d_dev *)dev->dev_private;
+       return container_of(dev, struct v3d_dev, drm);
 }
 
 static inline bool