Skip to content

Commit

Permalink
drm/v3d: Don't set drm_device->dev_private
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Cc: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
danvet committed Apr 28, 2020
1 parent 4cc9b56 commit af25c16
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/v3d/v3d_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/v3d/v3d_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af25c16

Please sign in to comment.