lkml.org 
[lkml]   [2022]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] clk: imx: scu: Fix pm_runtime_get_sync() error checking
Date
If the device is already in a runtime PM enabled state
pm_runtime_get_sync() will return 1, so a test for negative
value should be used to check for errors.

Fixes: 78edeb080330 ("clk: imx: scu: add runtime pm support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
drivers/clk/imx/clk-scu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/imx/clk-scu.c b/drivers/clk/imx/clk-scu.c
index 083da31dc3ea..18c6190eeffd 100644
--- a/drivers/clk/imx/clk-scu.c
+++ b/drivers/clk/imx/clk-scu.c
@@ -529,7 +529,7 @@ static int imx_clk_scu_probe(struct platform_device *pdev)
pm_runtime_enable(dev);

ret = pm_runtime_get_sync(dev);
- if (ret) {
+ if (ret < 0) {
pm_genpd_remove_device(dev);
pm_runtime_disable(dev);
return ret;
--
2.17.1
\
 
 \ /
  Last update: 2022-04-12 09:48    [W:0.162 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site