[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250827220005.82899-3-rosenp@gmail.com>
Date: Wed, 27 Aug 2025 15:00:04 -0700
From: Rosen Penev <rosenp@...il.com>
To: dmaengine@...r.kernel.org
Cc: Vinod Koul <vkoul@...nel.org>,
linux-kernel@...r.kernel.org (open list)
Subject: [PATCHv3 2/3] dmaengine: mv_xor: use devm_clk_get_optional_enabled
Driver was written before this was available. Simplifies code slightly.
Actually also a bugfix. clk_disable_unprepare is missing in _remove,
which is also missing.
Signed-off-by: Rosen Penev <rosenp@...il.com>
---
drivers/dma/mv_xor.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 3597ad8d1220..d15a1990534b 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -1351,9 +1351,9 @@ static int mv_xor_probe(struct platform_device *pdev)
/* Not all platforms can gate the clock, so it is not
* an error if the clock does not exists.
*/
- xordev->clk = clk_get(&pdev->dev, NULL);
- if (!IS_ERR(xordev->clk))
- clk_prepare_enable(xordev->clk);
+ xordev->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
+ if (IS_ERR(xordev->clk))
+ return PTR_ERR(xordev->clk);
/*
* We don't want to have more than one channel per CPU in
@@ -1441,11 +1441,6 @@ static int mv_xor_probe(struct platform_device *pdev)
irq_dispose_mapping(xordev->channels[i]->irq);
}
- if (!IS_ERR(xordev->clk)) {
- clk_disable_unprepare(xordev->clk);
- clk_put(xordev->clk);
- }
-
return ret;
}
--
2.51.0
Powered by blists - more mailing lists