Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: imx: scu: Use pm_runtime_resume_and_get to fix pm_runtime_get_sync() 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: 78edeb080330 ("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>

authored by

Miaoqian Lin and committed by
Abel Vesa
bfd594b3 39772efd

+1 -1
+1 -1
drivers/clk/imx/clk-scu.c
··· 528 528 pm_runtime_use_autosuspend(&pdev->dev); 529 529 pm_runtime_enable(dev); 530 530 531 - ret = pm_runtime_get_sync(dev); 531 + ret = pm_runtime_resume_and_get(dev); 532 532 if (ret) { 533 533 pm_genpd_remove_device(dev); 534 534 pm_runtime_disable(dev);