From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] soc: mediatek: Fix off-by-one checking for rate_spi
Date: Tue, 21 Apr 2015 12:59:53 +0200 [thread overview]
Message-ID: <20150421105953.GY6325@pengutronix.de> (raw)
In-Reply-To: <1429613612.5644.1.camel@ingics.com>
On Tue, Apr 21, 2015 at 06:53:32PM +0800, Axel Lin wrote:
> If rate_spi is 26000000, current code set ck_mhz to 18 rather than 26.
> Fix the off-by-one checking for rate_spi.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/soc/mediatek/mtk-pmic-wrap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
> index db5be1e..e910e19 100644
> --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
> +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
> @@ -568,9 +568,9 @@ static int pwrap_init_reg_clock(struct pmic_wrapper *wrp)
>
> rate_spi = clk_get_rate(wrp->clk_spi);
>
> - if (rate_spi > 26000000)
> + if (rate_spi >= 26000000)
> ck_mhz = 26;
> - else if (rate_spi > 18000000)
> + else if (rate_spi >= 18000000)
> ck_mhz = 18;
> else
> ck_mhz = 0;
> --
> 2.1.0
>
>
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2015-04-21 10:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-21 10:53 [PATCH] soc: mediatek: Fix off-by-one checking for rate_spi Axel Lin
2015-04-21 10:59 ` Sascha Hauer [this message]
[not found] ` <20150421105953.GY6325-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-04-21 11:46 ` Matthias Brugger
2015-04-21 11:46 ` Matthias Brugger
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=20150421105953.GY6325@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.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 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.