linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm: mx28: fix bit operation in clock setting
@ 2011-09-10 10:26 Wolfram Sang
  2011-11-16 13:20 ` Wolfram Sang
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2011-09-10 10:26 UTC (permalink / raw)
  To: linux-arm-kernel

reg | (1 << clk->enable_shift) always evaluates to true. Switch it
to & which makes much more sense. Same fix as 13be9f00 (ARM i.MX28: fix
bit operation) at a different location.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawn.guo@freescale.com>
---
 arch/arm/mach-mxs/clock-mx28.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
index 633c395..63d6117 100644
--- a/arch/arm/mach-mxs/clock-mx28.c
+++ b/arch/arm/mach-mxs/clock-mx28.c
@@ -413,7 +413,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate)		\
 	reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr);		\
 	reg &= ~BM_CLKCTRL_##dr##_DIV;					\
 	reg |= div << BP_CLKCTRL_##dr##_DIV;				\
-	if (reg | (1 << clk->enable_shift)) {				\
+	if (reg & (1 << clk->enable_shift)) {				\
 		pr_err("%s: clock is gated\n", __func__);		\
 		return -EINVAL;						\
 	}								\
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] arm: mx28: fix bit operation in clock setting
  2011-09-10 10:26 [PATCH] arm: mx28: fix bit operation in clock setting Wolfram Sang
@ 2011-11-16 13:20 ` Wolfram Sang
  2011-11-17  1:12   ` Shawn Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2011-11-16 13:20 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Sep 10, 2011 at 12:26:07PM +0200, Wolfram Sang wrote:
> reg | (1 << clk->enable_shift) always evaluates to true. Switch it
> to & which makes much more sense. Same fix as 13be9f00 (ARM i.MX28: fix
> bit operation) at a different location.
> 
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Shawn Guo <shawn.guo@freescale.com>
> ---

Ping.

>  arch/arm/mach-mxs/clock-mx28.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/arm/mach-mxs/clock-mx28.c b/arch/arm/mach-mxs/clock-mx28.c
> index 633c395..63d6117 100644
> --- a/arch/arm/mach-mxs/clock-mx28.c
> +++ b/arch/arm/mach-mxs/clock-mx28.c
> @@ -413,7 +413,7 @@ static int name##_set_rate(struct clk *clk, unsigned long rate)		\
>  	reg = __raw_readl(CLKCTRL_BASE_ADDR + HW_CLKCTRL_##dr);		\
>  	reg &= ~BM_CLKCTRL_##dr##_DIV;					\
>  	reg |= div << BP_CLKCTRL_##dr##_DIV;				\
> -	if (reg | (1 << clk->enable_shift)) {				\
> +	if (reg & (1 << clk->enable_shift)) {				\
>  		pr_err("%s: clock is gated\n", __func__);		\
>  		return -EINVAL;						\
>  	}								\
> -- 
> 1.7.5.4
> 

-- 
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20111116/96eb6c6f/attachment-0001.sig>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] arm: mx28: fix bit operation in clock setting
  2011-11-16 13:20 ` Wolfram Sang
@ 2011-11-17  1:12   ` Shawn Guo
  0 siblings, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2011-11-17  1:12 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Nov 16, 2011 at 02:20:42PM +0100, Wolfram Sang wrote:
> On Sat, Sep 10, 2011 at 12:26:07PM +0200, Wolfram Sang wrote:
> > reg | (1 << clk->enable_shift) always evaluates to true. Switch it
> > to & which makes much more sense. Same fix as 13be9f00 (ARM i.MX28: fix
> > bit operation) at a different location.
> > 
> > Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> > Cc: Sascha Hauer <s.hauer@pengutronix.de>
> > Cc: Shawn Guo <shawn.guo@freescale.com>
> > ---
> 
> Ping.
> 
Applied on mxs/fixes, thanks.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-17  1:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-10 10:26 [PATCH] arm: mx28: fix bit operation in clock setting Wolfram Sang
2011-11-16 13:20 ` Wolfram Sang
2011-11-17  1:12   ` Shawn Guo

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).