lkml.org 
[lkml]   [2015]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] clk: Show clock rate and error value when fail to set clock rate
Hi Sylwester,

On 04/27/2015 05:51 PM, Sylwester Nawrocki wrote:
> Hi Chanwoo,
>
> On 27/04/15 10:46, Chanwoo Choi wrote:
>>>> diff --git a/drivers/clk/clk-conf.c b/drivers/clk/clk-conf.c
>>>>>> index aad4796..2b6375f 100644
>>>>>> --- a/drivers/clk/clk-conf.c
>>>>>> +++ b/drivers/clk/clk-conf.c
>>>>>> @@ -107,8 +107,9 @@ 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 rate to %ld (%d)\n",
>>>>>> + __clk_get_name(clk), clk_get_rate(clk),
>>>>>> + rc);
>>>>
>>>> Apologies for my previous misleading comment, with this patch
>>>> you log current clock rate as the rate which was attempted to
>>>> be set. And these two will likely be different when clk_set_rate()
>>>> failed. So it should rather be:
>>>>
>>>> pr_err("clk: couldn't set %s clk rate to %ld (%d)\n",
>>>> __clk_get_name(clk), rate, rc);
>>
>> I'll modify it as following without error value.
>> If I add the error value, the number of character are over 80.
>> pr_err("clk: couldn't set %s clk rate to %ld\n",
>> __clk_get_name(clk), rate);
>
> I wouldn't worry about line length over 80 characters, it not a hard rule.
> Let's leave the error code as it might be useful for debugging.
>

OK, I'll add error value again.

Thanks,
Chanwoo Choi


\
 
 \ /
  Last update: 2015-04-27 11:41    [W:0.077 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site