public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Michael Turquette <mturquette@linaro.org>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	sboyd@codeaurora.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: Show clock rate instead of return value
Date: Mon, 13 Apr 2015 10:12:04 +0200	[thread overview]
Message-ID: <552B7A54.3070309@samsung.com> (raw)
In-Reply-To: <20150413045624.19585.73264@quantum>

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

      reply	other threads:[~2015-04-13  8:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=552B7A54.3070309@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=cw00.choi@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@linaro.org \
    --cc=sboyd@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox