Skip to contentSkip to conversation

S3C2443: Fix bit-reset in setrate of clk_armdiv

PATCH New Heiko Stübner 2 participants 2 messages Sep 22, 2011 – Sep 26, 2011

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

PATCH 1/1 S3C2443: Fix bit-reset in setrate of clk_armdiv

The changed statement should set the old armdiv bits to 0 and not everything else, before setting the new value.

---
 arch/arm/mach-s3c2443/clock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-s3c2443/clock.c +1 -1
index 966bde5..27549c4 100644
@@ -124,7 +124,7 @@ static int s3c2443_armclk_setrate(struct clk *clk, unsigned long rate)
 		unsigned long clkcon0;
 
 		clkcon0 = __raw_readl(S3C2443_CLKDIV0);
-		clkcon0 &= S3C2443_CLKDIV0_ARMDIV_MASK;
+		clkcon0 &= ~S3C2443_CLKDIV0_ARMDIV_MASK;
 		clkcon0 |= val << S3C2443_CLKDIV0_ARMDIV_SHIFT;
 		__raw_writel(clkcon0, S3C2443_CLKDIV0);
 	}
Signature · 1 line
1.7.2.3
#1 lore raw

PATCH 1/1 S3C2443: Fix bit-reset in setrate of clk_armdiv

arch/arm/mach-s3c2443/clock.c static int s3c2443_armclk_setrate(struct clk *clk,

Quoted 14 lines · Heiko St?bner

The changed statement should set the old armdiv bits to 0 and not everything else, before setting the new value.

---
 arch/arm/mach-s3c2443/clock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-s3c2443/clock.c +0 -0
index 966bde5..27549c4 100644
@@ -124,7 +124,7 @@ static int s3c2443_armclk_setrate(struct clk *clk,

unsigned

Quoted 11 lines
arch/arm/mach-s3c2443/clock.c +1 -1
 long rate)
 		unsigned long clkcon0;
 
 		clkcon0 = __raw_readl(S3C2443_CLKDIV0);
-		clkcon0 &= S3C2443_CLKDIV0_ARMDIV_MASK;
+		clkcon0 &= ~S3C2443_CLKDIV0_ARMDIV_MASK;
 		clkcon0 |= val << S3C2443_CLKDIV0_ARMDIV_SHIFT;
 		__raw_writel(clkcon0, S3C2443_CLKDIV0);

}
--
1.7.2.3

Hi Heiko,

Yes, you're right.
Applied, thanks.

Best regards,
Kgene.
--
Kukjin Kim <[email protected]>, Senior Engineer, SW Solution Development Team, Samsung Electronics Co., Ltd.