[PATCH 1/9] dmaengine: stm32-dmamux: simplify getting .driver_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
---

Build tested only. buildbot is happy.

 drivers/dma/stm32-dmamux.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c
index a42164389ebc..175f06749df6 100644
--- a/drivers/dma/stm32-dmamux.c
+++ b/drivers/dma/stm32-dmamux.c
@@ -305,8 +305,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev)
 #ifdef CONFIG_PM
 static int stm32_dmamux_runtime_suspend(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
+	struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev);
 
 	clk_disable_unprepare(stm32_dmamux->clk);
 
@@ -315,13 +314,12 @@ static int stm32_dmamux_runtime_suspend(struct device *dev)
 
 static int stm32_dmamux_runtime_resume(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
+	struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev);
 	int ret;
 
 	ret = clk_prepare_enable(stm32_dmamux->clk);
 	if (ret) {
-		dev_err(&pdev->dev, "failed to prepare_enable clock\n");
+		dev_err(dev, "failed to prepare_enable clock\n");
 		return ret;
 	}
 
@@ -332,8 +330,7 @@ static int stm32_dmamux_runtime_resume(struct device *dev)
 #ifdef CONFIG_PM_SLEEP
 static int stm32_dmamux_suspend(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
+	struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev);
 	int i, ret;
 
 	ret = pm_runtime_resume_and_get(dev);
@@ -353,8 +350,7 @@ static int stm32_dmamux_suspend(struct device *dev)
 
 static int stm32_dmamux_resume(struct device *dev)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
+	struct stm32_dmamux_data *stm32_dmamux = dev_get_drvdata(dev);
 	int i, ret;
 
 	ret = pm_runtime_force_resume(dev);
-- 
2.30.2




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux