Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sy…
Browse files Browse the repository at this point in the history
…nc() usage

If the device is already in a runtime PM enabled state
pm_runtime_get_sync() will return 1.

Also, we need to call pm_runtime_put_noidle() when pm_runtime_get_sync()
fails, so use pm_runtime_resume_and_get() instead. this function
will handle this.

Fixes: 78edeb0 ("clk: imx: scu: add runtime pm support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Link: https://lore.kernel.org/r/20220425011117.25093-1-linmq006@gmail.com
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
  • Loading branch information
Yuuoniy authored and abelvesa committed May 2, 2022
1 parent 39772ef commit bfd594b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/clk/imx/clk-scu.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)
pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_enable(dev);

ret = pm_runtime_get_sync(dev);
ret = pm_runtime_resume_and_get(dev);
if (ret) {
pm_genpd_remove_device(dev);
pm_runtime_disable(dev);
Expand Down

0 comments on commit bfd594b

Please sign in to comment.