Skip to content

Commit 7b11ef9

Browse files
houweitaoovinodkoul
authored andcommitted
dmaengine: stm32: use to_platform_device()
Use to_platform_device() instead of open-coding it. Signed-off-by: Weitao Hou <houweitaoo@gmail.com> Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent c54d866 commit 7b11ef9

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎drivers/dma/stm32-dmamux.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,7 @@ static int stm32_dmamux_probe(struct platform_device *pdev)
306306
#ifdef CONFIG_PM
307307
static int stm32_dmamux_runtime_suspend(struct device *dev)
308308
{
309-
struct platform_device *pdev =
310-
container_of(dev, struct platform_device, dev);
309+
struct platform_device *pdev = to_platform_device(dev);
311310
struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
312311

313312
clk_disable_unprepare(stm32_dmamux->clk);
@@ -317,8 +316,7 @@ static int stm32_dmamux_runtime_suspend(struct device *dev)
317316

318317
static int stm32_dmamux_runtime_resume(struct device *dev)
319318
{
320-
struct platform_device *pdev =
321-
container_of(dev, struct platform_device, dev);
319+
struct platform_device *pdev = to_platform_device(dev);
322320
struct stm32_dmamux_data *stm32_dmamux = platform_get_drvdata(pdev);
323321
int ret;
324322

0 commit comments

Comments
 (0)