media: platform: am437x: simplify getting .drvdata
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 19 Apr 2018 14:05:55 +0000 (10:05 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 9 May 2018 20:10:48 +0000 (16:10 -0400)
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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/am437x/am437x-vpfe.c

index 601ae6487617f7a5890b39f11d80c1dbc00480a1..58ebc2220d0e9d56a47ff55ea2bf2b41f5a50da0 100644 (file)
@@ -2662,8 +2662,7 @@ static void vpfe_save_context(struct vpfe_ccdc *ccdc)
 
 static int vpfe_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct vpfe_device *vpfe = platform_get_drvdata(pdev);
+       struct vpfe_device *vpfe = dev_get_drvdata(dev);
        struct vpfe_ccdc *ccdc = &vpfe->ccdc;
 
        /* if streaming has not started we don't care */
@@ -2720,8 +2719,7 @@ static void vpfe_restore_context(struct vpfe_ccdc *ccdc)
 
 static int vpfe_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct vpfe_device *vpfe = platform_get_drvdata(pdev);
+       struct vpfe_device *vpfe = dev_get_drvdata(dev);
        struct vpfe_ccdc *ccdc = &vpfe->ccdc;
 
        /* if streaming has not started we don't care */