Commit 2ea2113b authored by Wu Bo's avatar Wu Bo Committed by Shawn Guo

bus: imx-weim: change to use devm_clk_get_enabled() helper

Make the code cleaner and avoid call clk_disable_unprepare()
Signed-off-by: default avatarWu Bo <bo.wu@vivo.com>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent ce6697a6
...@@ -282,22 +282,18 @@ static int weim_probe(struct platform_device *pdev) ...@@ -282,22 +282,18 @@ static int weim_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, priv); dev_set_drvdata(&pdev->dev, priv);
/* get the clock */ /* get the clock */
clk = devm_clk_get(&pdev->dev, NULL); clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(clk)) if (IS_ERR(clk))
return PTR_ERR(clk); return PTR_ERR(clk);
ret = clk_prepare_enable(clk);
if (ret)
return ret;
/* parse the device node */ /* parse the device node */
ret = weim_parse_dt(pdev); ret = weim_parse_dt(pdev);
if (ret) if (ret)
clk_disable_unprepare(clk); return ret;
else
dev_info(&pdev->dev, "Driver registered.\n"); dev_info(&pdev->dev, "Driver registered.\n");
return ret; return 0;
} }
#if IS_ENABLED(CONFIG_OF_DYNAMIC) #if IS_ENABLED(CONFIG_OF_DYNAMIC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment