[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240830094118.15458-3-liaoyuanhong@vivo.com>
Date: Fri, 30 Aug 2024 17:41:13 +0800
From: Liao Yuanhong <liaoyuanhong@...o.com>
To: vkoul@...nel.org
Cc: dmaengine@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
imx@...ts.linux.dev,
Liao Yuanhong <liaoyuanhong@...o.com>
Subject: [PATCH v2 2/7] dmaengine:at_hdmac:Use devm_clk_get_enabled() helpers
Use devm_clk_get_enabled() instead of clk functions in at_hdmac.
Signed-off-by: Liao Yuanhong <liaoyuanhong@...o.com>
---
v2:remove modifications related to the resume operation.
---
drivers/dma/at_hdmac.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index 40052d1bd0b5..2274aeb58271 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -1975,20 +1975,16 @@ static int __init at_dma_probe(struct platform_device *pdev)
atdma->dma_device.cap_mask = plat_dat->cap_mask;
atdma->all_chan_mask = (1 << plat_dat->nr_channels) - 1;
- atdma->clk = devm_clk_get(&pdev->dev, "dma_clk");
+ atdma->clk = devm_clk_get_enabled(&pdev->dev, "dma_clk");
if (IS_ERR(atdma->clk))
return PTR_ERR(atdma->clk);
- err = clk_prepare_enable(atdma->clk);
- if (err)
- return err;
-
/* force dma off, just in case */
at_dma_off(atdma);
err = request_irq(irq, at_dma_interrupt, 0, "at_hdmac", atdma);
if (err)
- goto err_irq;
+ return err;
platform_set_drvdata(pdev, atdma);
@@ -2105,8 +2101,6 @@ static int __init at_dma_probe(struct platform_device *pdev)
dma_pool_destroy(atdma->lli_pool);
err_desc_pool_create:
free_irq(platform_get_irq(pdev, 0), atdma);
-err_irq:
- clk_disable_unprepare(atdma->clk);
return err;
}
@@ -2130,16 +2124,11 @@ static void at_dma_remove(struct platform_device *pdev)
atc_disable_chan_irq(atdma, chan->chan_id);
list_del(&chan->device_node);
}
-
- clk_disable_unprepare(atdma->clk);
}
static void at_dma_shutdown(struct platform_device *pdev)
{
- struct at_dma *atdma = platform_get_drvdata(pdev);
-
at_dma_off(platform_get_drvdata(pdev));
- clk_disable_unprepare(atdma->clk);
}
static int at_dma_prepare(struct device *dev)
@@ -2194,7 +2183,6 @@ static int at_dma_suspend_noirq(struct device *dev)
/* disable DMA controller */
at_dma_off(atdma);
- clk_disable_unprepare(atdma->clk);
return 0;
}
--
2.25.1
Powered by blists - more mailing lists