Skip to contentSkip to conversation

arm: mx28: fix bit operation in clock setting

PATCH New Wolfram Sang 2 participants 3 messages Sep 10, 2011 – Nov 17, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mx28: fix bit operation in clock setting

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.

Cc Sascha Hauer <[email protected]>
Cc Shawn Guo <[email protected]>
---
 arch/arm/mach-mxs/clock-mx28.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mxs/clock-mx28.c +1 -1
index 633c395..63d6117 100644
@@ -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;						\
 	}								\
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/1 arm: mx28: fix bit operation in clock setting

Quoted 8 lines · Wolfram Sang

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.

Cc Sascha Hauer <[email protected]>
Cc Shawn Guo <[email protected]>

---

Ping.

Quoted 19 lines
 arch/arm/mach-mxs/clock-mx28.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-mxs/clock-mx28.c +1 -1
index 633c395..63d6117 100644
@@ -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;						\
 	}								\
Signature · 1 line
1.7.5.4
Signature · 9 lines
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>
#2 lore raw

PATCH 1/1 arm: mx28: fix bit operation in clock setting

Quoted 5 lines · Wolfram Sang
Quoted 4 lines · Wolfram Sang

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.

Quoted 7 lines
Quoted 4 lines
Cc Sascha Hauer <[email protected]>
Cc Shawn Guo <[email protected]>

---

Ping.

Applied on mxs/fixes, thanks.

Signature · 2 lines
Regards,
Shawn