All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drivers/clk/clk: check return value of clk_pm_runtime_get()
@ 2022-09-03 22:41 Li Zhong
  2022-09-30  0:27 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zhong @ 2022-09-03 22:41 UTC (permalink / raw)
  To: linux-kernel, linux-clk; +Cc: mturquette, sboyd, Li Zhong

clk_pm_runtime_get() could fail. Check the return status.

Signed-off-by: Li Zhong <floridsleeves@gmail.com>
---
 drivers/clk/clk.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 7fc191c15507..09353f7bf052 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2981,8 +2981,12 @@ static void clk_summary_show_subtree(struct seq_file *s, struct clk_core *c,
 				     int level)
 {
 	struct clk_core *child;
+	int ret;
+    
+    ret = clk_pm_runtime_get(c);
+    if (ret)
+        return;
 
-	clk_pm_runtime_get(c);
 	clk_summary_show_one(s, c, level);
 	clk_pm_runtime_put(c);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] drivers/clk/clk: check return value of clk_pm_runtime_get()
  2022-09-03 22:41 [PATCH v2] drivers/clk/clk: check return value of clk_pm_runtime_get() Li Zhong
@ 2022-09-30  0:27 ` Stephen Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2022-09-30  0:27 UTC (permalink / raw)
  To: Li Zhong, linux-clk, linux-kernel; +Cc: mturquette, Li Zhong

Quoting Li Zhong (2022-09-03 15:41:25)
> clk_pm_runtime_get() could fail. Check the return status.
> 
> Signed-off-by: Li Zhong <floridsleeves@gmail.com>
> ---
>  drivers/clk/clk.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 7fc191c15507..09353f7bf052 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -2981,8 +2981,12 @@ static void clk_summary_show_subtree(struct seq_file *s, struct clk_core *c,
>                                      int level)
>  {
>         struct clk_core *child;
> +       int ret;
> +    
> +    ret = clk_pm_runtime_get(c);
> +    if (ret)
> +        return;
>  
> -       clk_pm_runtime_get(c);

The patch is malformed. It can't be applied, sorry. Also, shouldn't we
print something if we can't runtime PM get?

>         clk_summary_show_one(s, c, level);
>         clk_pm_runtime_put(c);
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-30  0:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-03 22:41 [PATCH v2] drivers/clk/clk: check return value of clk_pm_runtime_get() Li Zhong
2022-09-30  0:27 ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.