From: Hans-Christian Egtvedt <egtvedt@samfundet.no>
To: Paul Walmsley <pwalmsley@nvidia.com>
Cc: "Nicolas Ferre" <nicolas.ferre@atmel.com>,
"Håvard Skinnemoen" <hskinnemoen@gmail.com>,
"Jean-Christophe PLAGNIOL-VILLARD" <plagnioj@jcrosoft.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] avr32: favr-32: clk_round_rate() can return a zero upon error
Date: Tue, 10 Dec 2013 08:39:46 +0100 [thread overview]
Message-ID: <20131210073945.GD4196@samfundet.no> (raw)
In-Reply-To: <alpine.DEB.2.02.1312091827300.4127@tamien>
Around Mon 09 Dec 2013 18:35:24 -0800 or thereabout, 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.
>
> Signed-off-by: Paul Walmsley <paul@pwsan.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: Håvard Skinnemoen <hskinnemoen@gmail.com>
> Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Thanks for fixing, applied to for-linus branch in
git://git.kernel.org/pub/scm/linux/kernel/git/egtvedt/linux-avr32.git
Acked-by: Hans-Christian Egtvedt <egtvedt@samfundet.no>
> ---
> Applies on v3.13-rc3. See also:
>
> http://marc.info/?l=linux-arm-kernel&m=138542591313620&w=2
>
> arch/avr32/boards/favr-32/setup.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c
> index 7b1f2cd85400..1f121497b517 100644
> --- a/arch/avr32/boards/favr-32/setup.c
> +++ b/arch/avr32/boards/favr-32/setup.c
> @@ -298,8 +298,10 @@ static int __init set_abdac_rate(struct platform_device *pdev)
> */
> retval = clk_round_rate(pll1,
> CONFIG_BOARD_FAVR32_ABDAC_RATE * 256 * 16);
> - if (retval < 0)
> + if (retval <= 0) {
> + retval = -EINVAL;
> goto out_abdac;
> + }
>
> retval = clk_set_rate(pll1, retval);
> if (retval != 0)
--
mvh
Hans-Christian Egtvedt
prev parent reply other threads:[~2013-12-10 7:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-10 2:35 [PATCH] avr32: favr-32: clk_round_rate() can return a zero upon error Paul Walmsley
2013-12-10 7:39 ` Hans-Christian Egtvedt [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=20131210073945.GD4196@samfundet.no \
--to=egtvedt@samfundet.no \
--cc=hskinnemoen@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=plagnioj@jcrosoft.com \
--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