diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2006-01-14 13:21:17 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-14 18:27:13 -0800 |
commit | a07f0dbec01fda6d88f5089e21454b8df53d36fc (patch) | |
tree | f15c12ffd1aeaa0f7aa7530ad9dc6fd76810f9f0 /drivers/net | |
parent | 580d7b8cc59d68a3d26bfcc64c2053b464782c9a (diff) | |
download | linux-3.10-a07f0dbec01fda6d88f5089e21454b8df53d36fc.tar.gz linux-3.10-a07f0dbec01fda6d88f5089e21454b8df53d36fc.tar.bz2 linux-3.10-a07f0dbec01fda6d88f5089e21454b8df53d36fc.zip |
[PATCH] cs89x0: use u16 for device register data
cs89x0 inconsistently used 'int' and 'u32' for device register data.
As the cs89x0 is a 16-bit chip, change the I/O accessors over to 'u16'.
(Spotted by Deepak Saxena.)
Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/cs89x0.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/cs89x0.c b/drivers/net/cs89x0.c index a7ef8a66ba0..2687b3e0994 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c @@ -342,38 +342,38 @@ out: #endif #if defined(CONFIG_ARCH_IXDP2X01) -static int +static u16 readword(unsigned long base_addr, int portno) { - return (u16)__raw_readl(base_addr + (portno << 1)); + return __raw_readl(base_addr + (portno << 1)); } static void -writeword(unsigned long base_addr, int portno, int value) +writeword(unsigned long base_addr, int portno, u16 value) { - __raw_writel((u16)value, base_addr + (portno << 1)); + __raw_writel(value, base_addr + (portno << 1)); } #elif defined(CONFIG_ARCH_PNX010X) -static int +static u16 readword(unsigned long base_addr, int portno) { return inw(base_addr + (portno << 1)); } static void -writeword(unsigned long base_addr, int portno, int value) +writeword(unsigned long base_addr, int portno, u16 value) { outw(value, base_addr + (portno << 1)); } #else -static int +static u16 readword(unsigned long base_addr, int portno) { return inw(base_addr + portno); } static void -writeword(unsigned long base_addr, int portno, int value) +writeword(unsigned long base_addr, int portno, u16 value) { outw(value, base_addr + portno); } @@ -385,11 +385,11 @@ readwords(unsigned long base_addr, int portno, void *buf, int length) u8 *buf8 = (u8 *)buf; do { - u32 tmp32; + u16 tmp16; - tmp32 = readword(base_addr, portno); - *buf8++ = (u8)tmp32; - *buf8++ = (u8)(tmp32 >> 8); + tmp16 = readword(base_addr, portno); + *buf8++ = (u8)tmp16; + *buf8++ = (u8)(tmp16 >> 8); } while (--length); } @@ -399,23 +399,23 @@ writewords(unsigned long base_addr, int portno, void *buf, int length) u8 *buf8 = (u8 *)buf; do { - u32 tmp32; + u16 tmp16; - tmp32 = *buf8++; - tmp32 |= (*buf8++) << 8; - writeword(base_addr, portno, tmp32); + tmp16 = *buf8++; + tmp16 |= (*buf8++) << 8; + writeword(base_addr, portno, tmp16); } while (--length); } -static int -readreg(struct net_device *dev, int regno) +static u16 +readreg(struct net_device *dev, u16 regno) { writeword(dev->base_addr, ADD_PORT, regno); return readword(dev->base_addr, DATA_PORT); } static void -writereg(struct net_device *dev, int regno, int value) +writereg(struct net_device *dev, u16 regno, u16 value) { writeword(dev->base_addr, ADD_PORT, regno); writeword(dev->base_addr, DATA_PORT, value); |