media: platform: s5p-mfc: simplify getting .drvdata
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 19 Apr 2018 14:05:57 +0000 (10:05 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 4 Jul 2018 15:45:40 +0000 (11:45 -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>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/s5p-mfc/s5p_mfc.c

index a80251ed31436d816b00f136572c26272bd0f36e..9ca707cb2a4296dc105be3e2a1de24406daf9cb2 100644 (file)
@@ -1449,8 +1449,7 @@ static int s5p_mfc_remove(struct platform_device *pdev)
 
 static int s5p_mfc_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct s5p_mfc_dev *m_dev = platform_get_drvdata(pdev);
+       struct s5p_mfc_dev *m_dev = dev_get_drvdata(dev);
        int ret;
 
        if (m_dev->num_inst == 0)
@@ -1484,8 +1483,7 @@ static int s5p_mfc_suspend(struct device *dev)
 
 static int s5p_mfc_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct s5p_mfc_dev *m_dev = platform_get_drvdata(pdev);
+       struct s5p_mfc_dev *m_dev = dev_get_drvdata(dev);
 
        if (m_dev->num_inst == 0)
                return 0;