linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Rui <rui.zhang@intel.com>
To: Paul Walmsley <pwalmsley@nvidia.com>
Cc: Eduardo Valentin <eduardo.valentin@ti.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH] thermal: ti-soc-thermal: clk_round_rate() can return a zero upon error
Date: Thu, 02 Jan 2014 10:51:08 +0800	[thread overview]
Message-ID: <1388631068.3739.73.camel@rzhang1-mobl4> (raw)
In-Reply-To: <alpine.DEB.2.02.1312091803260.4127@tamien>

On Mon, 2013-12-09 at 18:09 -0800, Paul Walmsley wrote:
> Treat both negative and zero return values from clk_round_rate() as
> errors.  This is needed since subsequent patches will convert
> clk_round_rate()'s return value to be an unsigned type, rather than a
> signed type, since some clock sources can generate rates higher than
> (2^31)-1 Hz.
> 
> Eventually, when calling clk_round_rate(), only a return value of zero
> will be considered a error.  All other values will be considered valid
> rates.  The comparison against values less than 0 is kept to preserve
> the correct behavior in the meantime.
> 
> This patch also gets rid of a comparison between unsigned and signed 
> values; a side-benefit.
> 
> Signed-off-by: Paul Walmsley <pwalmsley@nvidia.com>
> Cc: Eduardo Valentin <eduardo.valentin@ti.com>
> Cc: Zhang Rui <rui.zhang@intel.com>

Eduardo,

will you take this patch?

thanks,
rui
> ---
> Applies on v3.13-rc3.  See also:
> 
> http://marc.info/?l=linux-arm-kernel&m=138542591313620&w=2
> 
>   drivers/thermal/ti-soc-thermal/ti-bandgap.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> index 74c0e3474d6e..8fe46dbc0c6f 100644
> --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c
> @@ -1248,7 +1248,7 @@ int ti_bandgap_probe(struct platform_device *pdev)
>   	clk_rate = clk_round_rate(bgp->div_clk,
>   				  bgp->conf->sensors[0].ts_data->max_freq);
>   	if (clk_rate < bgp->conf->sensors[0].ts_data->min_freq ||
> -	    clk_rate == 0xffffffff) {
> +	    clk_rate <= 0) {
>   		ret = -ENODEV;
>   		dev_err(&pdev->dev, "wrong clock rate (%d)\n", clk_rate);
>   		goto put_clks;



      reply	other threads:[~2014-01-02  2:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-10  2:09 [PATCH] thermal: ti-soc-thermal: clk_round_rate() can return a zero upon error Paul Walmsley
2014-01-02  2:51 ` Zhang Rui [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=1388631068.3739.73.camel@rzhang1-mobl4 \
    --to=rui.zhang@intel.com \
    --cc=eduardo.valentin@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pwalmsley@nvidia.com \
    /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;
as well as URLs for NNTP newsgroup(s).