summaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorWu Bo <bo.wu@vivo.com>2024-08-27 05:23:48 +0200
committerShawn Guo <shawnguo@kernel.org>2024-09-01 11:06:33 +0200
commit2ea2113b3dacf9cf616488f875f32584dad53ff8 (patch)
tree19d37af6dcffa8fbadcf5c2b95c5950779532d4c /drivers/bus
parentbus: imx-weim: support compile test (diff)
downloadlinux-2ea2113b3dacf9cf616488f875f32584dad53ff8.tar.xz
linux-2ea2113b3dacf9cf616488f875f32584dad53ff8.zip
bus: imx-weim: change to use devm_clk_get_enabled() helper
Make the code cleaner and avoid call clk_disable_unprepare() Signed-off-by: Wu Bo <bo.wu@vivo.com> Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/imx-weim.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c
index 837bf9d51c6e..83d623d97f5f 100644
--- a/drivers/bus/imx-weim.c
+++ b/drivers/bus/imx-weim.c
@@ -282,22 +282,18 @@ static int weim_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, priv);
/* get the clock */
- clk = devm_clk_get(&pdev->dev, NULL);
+ clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(clk))
return PTR_ERR(clk);
- ret = clk_prepare_enable(clk);
- if (ret)
- return ret;
-
/* parse the device node */
ret = weim_parse_dt(pdev);
if (ret)
- clk_disable_unprepare(clk);
- else
- dev_info(&pdev->dev, "Driver registered.\n");
+ return ret;
- return ret;
+ dev_info(&pdev->dev, "Driver registered.\n");
+
+ return 0;
}
#if IS_ENABLED(CONFIG_OF_DYNAMIC)