diff mbox series

[1/1] pinctrl: mvebu: use devm_clk_get_enabled() in dove_pinctrl_probe()

Message ID 20230720140803.33174-1-ruc_gongyuanjun@163.com
State New
Headers show
Series [1/1] pinctrl: mvebu: use devm_clk_get_enabled() in dove_pinctrl_probe() | expand

Commit Message

Yuanjun Gong July 20, 2023, 2:08 p.m. UTC
in dove_pinctrl_probe(), the return value of function
clk_prepare_enable() should be checked, since it may fail.
using devm_clk_get_enabled() instead of devm_clk_get() and
clk_prepare_enable() can avoid this problem.

Signed-off-by: Yuanjun Gong <ruc_gongyuanjun@163.com>
---
 drivers/pinctrl/mvebu/pinctrl-dove.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/pinctrl/mvebu/pinctrl-dove.c b/drivers/pinctrl/mvebu/pinctrl-dove.c
index 545486d98532..bcd72fef4c85 100644
--- a/drivers/pinctrl/mvebu/pinctrl-dove.c
+++ b/drivers/pinctrl/mvebu/pinctrl-dove.c
@@ -777,12 +777,11 @@  static int dove_pinctrl_probe(struct platform_device *pdev)
 	 * General MPP Configuration Register is part of pdma registers.
 	 * grab clk to make sure it is ticking.
 	 */
-	clk = devm_clk_get(&pdev->dev, NULL);
+	clk = devm_clk_get_enabled(&pdev->dev, NULL);
 	if (IS_ERR(clk)) {
 		dev_err(&pdev->dev, "Unable to get pdma clock");
 		return PTR_ERR(clk);
 	}
-	clk_prepare_enable(clk);
 
 	mpp_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	base = devm_ioremap_resource(&pdev->dev, mpp_res);