All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: Show clock rate instead of return value
@ 2015-04-02  6:40 Chanwoo Choi
  2015-04-13  4:56 ` Michael Turquette
  0 siblings, 1 reply; 3+ messages in thread
From: Chanwoo Choi @ 2015-04-02  6:40 UTC (permalink / raw)
  To: mturquette, sboyd; +Cc: linux-kernel, Chanwoo Choi

This patch shows the current clock rate instead of return value
when clk_set_rate() return fail because log message means the clock rate.

Cc: Mike Turquette <mturquette@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/clk/clk-conf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
index aad4796..fb1ee65 100644
--- a/drivers/clk/clk-conf.c
+++ b/drivers/clk/clk-conf.c
@@ -107,8 +107,8 @@ static int __set_clk_rates(struct device_node *node, bool clk_supplier)
 
 			rc = clk_set_rate(clk, rate);
 			if (rc < 0)
-				pr_err("clk: couldn't set %s clock rate: %d\n",
-				       __clk_get_name(clk), rc);
+				pr_err("clk: couldn't set %s clock rate: %ld\n",
+				       __clk_get_name(clk), clk_get_rate(clk));
 			clk_put(clk);
 		}
 		index++;
-- 
1.8.5.5


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

* Re: [PATCH] clk: Show clock rate instead of return value
  2015-04-02  6:40 [PATCH] clk: Show clock rate instead of return value Chanwoo Choi
@ 2015-04-13  4:56 ` Michael Turquette
  2015-04-13  8:12   ` Sylwester Nawrocki
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Turquette @ 2015-04-13  4:56 UTC (permalink / raw)
  To: Chanwoo Choi, sboyd; +Cc: linux-kernel, Chanwoo Choi, Sylwester Nawrocki

+Sylwester

Quoting Chanwoo Choi (2015-04-01 23:40:36)
> This patch shows the current clock rate instead of return value
> when clk_set_rate() return fail because log message means the clock rate.
> 
> Cc: Mike Turquette <mturquette@linaro.org>
> Cc: Stephen Boyd <sboyd@codeaurora.org>
> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
> ---
>  drivers/clk/clk-conf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
> index aad4796..fb1ee65 100644
> --- a/drivers/clk/clk-conf.c
> +++ b/drivers/clk/clk-conf.c
> @@ -107,8 +107,8 @@ static int __set_clk_rates(struct device_node *node, bool clk_supplier)
>  
>                         rc = clk_set_rate(clk, rate);
>                         if (rc < 0)
> -                               pr_err("clk: couldn't set %s clock rate: %d\n",
> -                                      __clk_get_name(clk), rc);
> +                               pr_err("clk: couldn't set %s clock rate: %ld\n",
> +                                      __clk_get_name(clk), clk_get_rate(clk));

Change seems OK, but what was Sylwester's original intent? We can always
look up the original/current rate in sysfs, but getting the error code
printed might be useful for debugging...

Regards,
Mike

>                         clk_put(clk);
>                 }
>                 index++;
> -- 
> 1.8.5.5
> 

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

* Re: [PATCH] clk: Show clock rate instead of return value
  2015-04-13  4:56 ` Michael Turquette
@ 2015-04-13  8:12   ` Sylwester Nawrocki
  0 siblings, 0 replies; 3+ messages in thread
From: Sylwester Nawrocki @ 2015-04-13  8:12 UTC (permalink / raw)
  To: Michael Turquette, Chanwoo Choi, sboyd; +Cc: linux-kernel

Hello,

On 13/04/15 06:56, Michael Turquette wrote:
> +Sylwester
> 
> Quoting Chanwoo Choi (2015-04-01 23:40:36)
>> This patch shows the current clock rate instead of return value
>> when clk_set_rate() return fail because log message means the clock rate.
>>
>> Cc: Mike Turquette <mturquette@linaro.org>
>> Cc: Stephen Boyd <sboyd@codeaurora.org>
>> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
>> ---
>>  drivers/clk/clk-conf.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
>> index aad4796..fb1ee65 100644
>> --- a/drivers/clk/clk-conf.c
>> +++ b/drivers/clk/clk-conf.c
>> @@ -107,8 +107,8 @@ static int __set_clk_rates(struct device_node *node, bool clk_supplier)
>>  
>>                         rc = clk_set_rate(clk, rate);
>>                         if (rc < 0)
>> -                               pr_err("clk: couldn't set %s clock rate: %d\n",
>> -                                      __clk_get_name(clk), rc);
>> +                               pr_err("clk: couldn't set %s clock rate: %ld\n",
>> +                                      __clk_get_name(clk), clk_get_rate(clk));
> 
> Change seems OK, but what was Sylwester's original intent? We can always
> look up the original/current rate in sysfs, but getting the error code
> printed might be useful for debugging...

Indeed, I thought it was more useful to have the error code shown here.
Alternatively we could make it:

 pr_err("clk: couldn't set %s clock rate to %ld (%d)\n",
        __clk_get_name(clk), clk_get_rate(clk), rc);


-- 
Thanks
Sylwester

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

end of thread, other threads:[~2015-04-13  8:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-02  6:40 [PATCH] clk: Show clock rate instead of return value Chanwoo Choi
2015-04-13  4:56 ` Michael Turquette
2015-04-13  8:12   ` Sylwester Nawrocki

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.