mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
fbdev: mmp: Use devm_clk_get_enabled() helpers
The devm_clk_get_enabled() helpers: - call devm_clk_get() - call clk_prepare_enable() and register what is needed in order to call clk_disable_unprepare() when needed, as a managed resource. This simplifies the code and avoids the calls to clk_disable_unprepare(). Signed-off-by: ying zuxin <yingzuxin@vivo.com> Signed-off-by: Helge Deller <deller@gmx.de>
This commit is contained in:
parent
aa578e8975
commit
5ee70bec79
@ -512,16 +512,13 @@ static int mmphw_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
/* get clock */
|
||||
ctrl->clk = devm_clk_get(ctrl->dev, mi->clk_name);
|
||||
ctrl->clk = devm_clk_get_enabled(ctrl->dev, mi->clk_name);
|
||||
if (IS_ERR(ctrl->clk)) {
|
||||
ret = PTR_ERR(ctrl->clk);
|
||||
dev_err_probe(ctrl->dev, ret,
|
||||
"unable to get clk %s\n", mi->clk_name);
|
||||
goto failed;
|
||||
}
|
||||
ret = clk_prepare_enable(ctrl->clk);
|
||||
if (ret)
|
||||
goto failed;
|
||||
|
||||
/* init global regs */
|
||||
ctrl_set_default(ctrl);
|
||||
@ -556,7 +553,6 @@ static int mmphw_probe(struct platform_device *pdev)
|
||||
path_deinit(path_plat);
|
||||
}
|
||||
|
||||
clk_disable_unprepare(ctrl->clk);
|
||||
failed:
|
||||
dev_err(&pdev->dev, "device init failed\n");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user