gpu: drm: vc4: simplify getting .drvdata
authorWolfram Sang <[email protected]>
Thu, 19 Apr 2018 14:05:46 +0000 (16:05 +0200)
committerEric Anholt <[email protected]>
Mon, 23 Apr 2018 17:50:05 +0000 (10:50 -0700)
We should get drvdata from struct device directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Eric Anholt <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/vc4/vc4_drv.c

index 94b99c90425a488cfaec255b1f2030f9b31242b3..af9515ae0e0a497fe5dbc03a25e3034bb39ae171 100644 (file)
@@ -318,8 +318,7 @@ dev_unref:
 
 static void vc4_drm_unbind(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct drm_device *drm = platform_get_drvdata(pdev);
+       struct drm_device *drm = dev_get_drvdata(dev);
 
        drm_dev_unregister(drm);