]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
dmaengine: idma64: simplify getting .drvdata
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 22 Apr 2018 09:14:12 +0000 (11:14 +0200)
committerVinod Koul <vkoul@kernel.org>
Sun, 22 Apr 2018 16:07:37 +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/idma64.c

index 1953e57505f4b4493d3d55bbfec102fdb4ede615..e5c911200bdb4a15920181c85e13fe47705214e6 100644 (file)
@@ -670,8 +670,7 @@ static int idma64_platform_remove(struct platform_device *pdev)
 
 static int idma64_pm_suspend(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct idma64_chip *chip = platform_get_drvdata(pdev);
+       struct idma64_chip *chip = dev_get_drvdata(dev);
 
        idma64_off(chip->idma64);
        return 0;
@@ -679,8 +678,7 @@ static int idma64_pm_suspend(struct device *dev)
 
 static int idma64_pm_resume(struct device *dev)
 {
-       struct platform_device *pdev = to_platform_device(dev);
-       struct idma64_chip *chip = platform_get_drvdata(pdev);
+       struct idma64_chip *chip = dev_get_drvdata(dev);
 
        idma64_on(chip->idma64);
        return 0;