mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 16:52:18 +00:00
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>
This commit is contained in:
parent
ce6697a613
commit
2ea2113b3d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user