[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190526071324.15307-1-houweitaoo@gmail.com>
Date: Sun, 26 May 2019 15:13:24 +0800
From: Weitao Hou <houweitaoo@...il.com>
To: vkoul@...nel.org, dan.j.williams@...el.com,
mcoquelin.stm32@...il.com, alexandre.torgue@...com
Cc: dmaengine@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Weitao Hou <houweitaoo@...il.com>
Subject: [PATCH] dmaengine: use to_platform_device()
Use to_platform_device() instead of open-coding it.
Signed-off-by: Weitao Hou <houweitaoo@...il.com>
---
drivers/dma/stm32-dmamux.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/stm32-dmamux.c b/drivers/dma/stm32-dmamux.c
index a67119199c45..63af24d4c834 100644
--- a/drivers/dma/stm32-dmamux.c
+++ b/drivers/dma/stm32-dmamux.c
@@ -306,8 +306,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 =
- container_of(dev, struct platform_device, dev);
+ struct platform_device *pdev = to_platform_device(dev);
struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
clk_disable_unprepare(stm32_dmamux->clk);
@@ -317,8 +316,7 @@ static int stm32_dmamux_runtime_suspend(struct device *dev)
static int stm32_dmamux_runtime_resume(struct device *dev)
{
- struct platform_device *pdev =
- container_of(dev, struct platform_device, dev);
+ struct platform_device *pdev = to_platform_device(dev);
struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
int ret;
--
2.18.0
Powered by blists - more mailing lists