]> git.baikalelectronics.ru Git - kernel.git/commitdiff
gpu: drm: vc4: simplify getting .drvdata
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 19 Apr 2018 14:05:46 +0000 (16:05 +0200)
committerEric Anholt <eric@anholt.net>
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 <wsa+renesas@sang-engineering.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20180419140641.27926-17-wsa+renesas@sang-engineering.com
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);