diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2020-04-15 10:39:45 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2020-04-28 16:15:59 +0300 |
commit | 0df3ac7657c92756a26c164133380edbce672f7a (patch) | |
tree | c07d95bab33016ce95bdffa3f59e7d20848989fb /drivers/gpu/drm/v3d/v3d_drv.c | |
parent | bc662528e29ae751e0d43c18c9e4cd71a20ef0d4 (diff) | |
download | linux-0df3ac7657c92756a26c164133380edbce672f7a.tar.xz |
drm/v3d: Delete v3d_dev->pdev
We already have it in v3d_dev->drm.dev with zero additional pointer
chasing. Personally I don't like duplicated pointers like this
because:
- reviewers need to check whether the pointer is for the same or
different objects if there's multiple
- compilers have an easier time too
To avoid having to pull in some big headers I implemented the casting
function as a macro instead of a static inline. Typechecking thanks to
container_of still assured.
But also a bit a bikeshed, so feel free to ignore.
v2: More parens for v3d_to_pdev macro (checkpatch)
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-11-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/v3d/v3d_drv.c')
-rw-r--r-- | drivers/gpu/drm/v3d/v3d_drv.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/v3d/v3d_drv.c b/drivers/gpu/drm/v3d/v3d_drv.c index 37cb880f2826..82a7dfdd14c2 100644 --- a/drivers/gpu/drm/v3d/v3d_drv.c +++ b/drivers/gpu/drm/v3d/v3d_drv.c @@ -235,7 +235,7 @@ static int map_regs(struct v3d_dev *v3d, void __iomem **regs, const char *name) { struct resource *res = - platform_get_resource_byname(v3d->pdev, IORESOURCE_MEM, name); + platform_get_resource_byname(v3d_to_pdev(v3d), IORESOURCE_MEM, name); *regs = devm_ioremap_resource(v3d->drm.dev, res); return PTR_ERR_OR_ZERO(*regs); @@ -255,7 +255,6 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) if (IS_ERR(v3d)) return PTR_ERR(v3d); - v3d->pdev = pdev; drm = &v3d->drm; platform_set_drvdata(pdev, drm); |