Skip to contentSkip to conversation

misc/ep93xx_pwm: use {read,write}* instead of __raw_* versions for io

PATCH In review H Hartley Sweeten 2 participants 4 messages May 24, 2013 – May 27, 2013 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 2/14 misc/ep93xx_pwm: use {read,write}* instead of __raw_* versions for io

The mmio_base is an ioremap'ed memory resource. The normal memory io functions should be used not the __raw_* versions.

Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Cc Ryan Mallon <[email protected]>
Cc Matthieu Crapet <[email protected]>
---
 drivers/misc/ep93xx_pwm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/ep93xx_pwm.c +2 -2
index 36370b4..af01fb9 100644
@@ -42,13 +42,13 @@ struct ep93xx_pwm {
 static inline void ep93xx_pwm_writel(struct ep93xx_pwm *pwm,
 		unsigned int val, unsigned int off)
 {
-	__raw_writel(val, pwm->mmio_base + off);
+	writel(val, pwm->mmio_base + off);
 }
 
 static inline unsigned int ep93xx_pwm_readl(struct ep93xx_pwm *pwm,
 		unsigned int off)
 {
-	return __raw_readl(pwm->mmio_base + off);
+	return readl(pwm->mmio_base + off);
 }
 
 static inline void ep93xx_pwm_write_tc(struct ep93xx_pwm *pwm, u16 value)
Signature · 1 line
1.8.1.4
maintainer
#1 lore raw

drivers/misc/ep93xx_pwm.c struct ep93xx_pwm { · line 46

Quoted 7 lines · H Hartley Sweeten
drivers/misc/ep93xx_pwm.c +1 -1
@@ -42,13 +42,13 @@ struct ep93xx_pwm {
 static inline void ep93xx_pwm_writel(struct ep93xx_pwm *pwm,
                unsigned int val, unsigned int off)
 {
-       __raw_writel(val, pwm->mmio_base + off);
+       writel(val, pwm->mmio_base + off);
 }

Just an idea: since you are adding the writel in a lot of places in subsequent patches, you could rename 'mmio_base' to the shorter 'base' first, which would make the resulting code actually smaller.

Arnd

#2 lore raw
Quoted 12 lines · Arnd Bergmann

drivers/misc/ep93xx_pwm.c struct ep93xx_pwm { · line 46

Quoted 7 lines · H Hartley Sweeten
drivers/misc/ep93xx_pwm.c +1 -1
@@ -42,13 +42,13 @@ struct ep93xx_pwm {
 static inline void ep93xx_pwm_writel(struct ep93xx_pwm *pwm,
                unsigned int val, unsigned int off)
 {
-       __raw_writel(val, pwm->mmio_base + off);
+       writel(val, pwm->mmio_base + off);
 }

Just an idea: since you are adding the writel in a lot of places in subsequent patches, you could rename 'mmio_base' to the shorter 'base' first, which would make the resulting code actually smaller.

Hmm.. It would make the source file a bit smaller but the compiled size would be the same.

But, I'll probably rename the variable when I convert this driver to the PWM framework.

Thanks,
Hartley

maintainer
#3 lore raw
Quoted 14 lines · H Hartley Sweeten
Quoted 12 lines · Arnd Bergmann

drivers/misc/ep93xx_pwm.c struct ep93xx_pwm { · line 46

Quoted 7 lines · H Hartley Sweeten
drivers/misc/ep93xx_pwm.c +1 -1
@@ -42,13 +42,13 @@ struct ep93xx_pwm {
 static inline void ep93xx_pwm_writel(struct ep93xx_pwm *pwm,
                unsigned int val, unsigned int off)
 {
-       __raw_writel(val, pwm->mmio_base + off);
+       writel(val, pwm->mmio_base + off);
 }

Just an idea: since you are adding the writel in a lot of places in subsequent patches, you could rename 'mmio_base' to the shorter 'base' first, which would make the resulting code actually smaller.

Quoted 2 lines

Hmm.. It would make the source file a bit smaller but the compiled size would be the same.

Right.

Quoted 2 lines

But, I'll probably rename the variable when I convert this driver to the PWM framework.

Ok.

Arnd