dmaengine: fsldma: simplify getting .drvdata
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 22 Apr 2018 09:14:11 +0000 (11:14 +0200)
committerVinod Koul <vkoul@kernel.org>
Sun, 22 Apr 2018 16:07:17 +0000 (21:37 +0530)
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: Vinod Koul <vkoul@kernel.org>
drivers/dma/fsldma.c

index 3eaece8..1117b51 100644 (file)
@@ -1328,8 +1328,7 @@ static int fsldma_of_remove(struct platform_device *op)
 #ifdef CONFIG_PM
 static int fsldma_suspend_late(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct fsldma_device *fdev = platform_get_drvdata(pdev);
+       struct fsldma_device *fdev = dev_get_drvdata(dev);
        struct fsldma_chan *chan;
        int i;
 
@@ -1360,8 +1359,7 @@ out:
 
 static int fsldma_resume_early(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct fsldma_device *fdev = platform_get_drvdata(pdev);
+       struct fsldma_device *fdev = dev_get_drvdata(dev);
        struct fsldma_chan *chan;
        u32 mode;
        int i;