diff options
author | Lennert Buytenhek <buytenh@wantstofly.org> | 2006-01-14 16:21:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-14 21:27:13 -0500 |
commit | a07f0dbec01fda6d88f5089e21454b8df53d36fc (patch) | |
tree | f15c12ffd1aeaa0f7aa7530ad9dc6fd76810f9f0 /drivers/net/cs89x0.c | |
parent | 580d7b8cc59d68a3d26bfcc64c2053b464782c9a (diff) |
[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/cs89x0.c')
-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 a7ef8a66ba0f..2687b3e0994d 100644 --- a/drivers/net/cs89x0.c +++ b/drivers/net/cs89x0.c | |||
@@ -342,38 +342,38 @@ out: | |||
342 | #endif | 342 | #endif |
343 | 343 | ||
344 | #if defined(CONFIG_ARCH_IXDP2X01) | 344 | #if defined(CONFIG_ARCH_IXDP2X01) |
345 | static int | 345 | static u16 |
346 | readword(unsigned long base_addr, int portno) | 346 | readword(unsigned long base_addr, int portno) |
347 | { | 347 | { |
348 | return (u16)__raw_readl(base_addr + (portno << 1)); | 348 | return __raw_readl(base_addr + (portno << 1)); |
349 | } | 349 | } |
350 | 350 | ||
351 | static void | 351 | static void |
352 | writeword(unsigned long base_addr, int portno, int value) | 352 | writeword(unsigned long base_addr, int portno, u16 value) |
353 | { | 353 | { |
354 | __raw_writel((u16)value, base_addr + (portno << 1)); | 354 | __raw_writel(value, base_addr + (portno << 1)); |
355 | } | 355 | } |
356 | #elif defined(CONFIG_ARCH_PNX010X) | 356 | #elif defined(CONFIG_ARCH_PNX010X) |
357 | static int | 357 | static u16 |
358 | readword(unsigned long base_addr, int portno) | 358 | readword(unsigned long base_addr, int portno) |
359 | { | 359 | { |
360 | return inw(base_addr + (portno << 1)); | 360 | return inw(base_addr + (portno << 1)); |
361 | } | 361 | } |
362 | 362 | ||
363 | static void | 363 | static void |
364 | writeword(unsigned long base_addr, int portno, int value) | 364 | writeword(unsigned long base_addr, int portno, u16 value) |
365 | { | 365 | { |
366 | outw(value, base_addr + (portno << 1)); | 366 | outw(value, base_addr + (portno << 1)); |
367 | } | 367 | } |
368 | #else | 368 | #else |
369 | static int | 369 | static u16 |
370 | readword(unsigned long base_addr, int portno) | 370 | readword(unsigned long base_addr, int portno) |
371 | { | 371 | { |
372 | return inw(base_addr + portno); | 372 | return inw(base_addr + portno); |
373 | } | 373 | } |
374 | 374 | ||
375 | static void | 375 | static void |
376 | writeword(unsigned long base_addr, int portno, int value) | 376 | writeword(unsigned long base_addr, int portno, u16 value) |
377 | { | 377 | { |
378 | outw(value, base_addr + portno); | 378 | outw(value, base_addr + portno); |
379 | } | 379 | } |
@@ -385,11 +385,11 @@ readwords(unsigned long base_addr, int portno, void *buf, int length) | |||
385 | u8 *buf8 = (u8 *)buf; | 385 | u8 *buf8 = (u8 *)buf; |
386 | 386 | ||
387 | do { | 387 | do { |
388 | u32 tmp32; | 388 | u16 tmp16; |
389 | 389 | ||
390 | tmp32 = readword(base_addr, portno); | 390 | tmp16 = readword(base_addr, portno); |
391 | *buf8++ = (u8)tmp32; | 391 | *buf8++ = (u8)tmp16; |
392 | *buf8++ = (u8)(tmp32 >> 8); | 392 | *buf8++ = (u8)(tmp16 >> 8); |
393 | } while (--length); | 393 | } while (--length); |
394 | } | 394 | } |
395 | 395 | ||
@@ -399,23 +399,23 @@ writewords(unsigned long base_addr, int portno, void *buf, int length) | |||
399 | u8 *buf8 = (u8 *)buf; | 399 | u8 *buf8 = (u8 *)buf; |
400 | 400 | ||
401 | do { | 401 | do { |
402 | u32 tmp32; | 402 | u16 tmp16; |
403 | 403 | ||
404 | tmp32 = *buf8++; | 404 | tmp16 = *buf8++; |
405 | tmp32 |= (*buf8++) << 8; | 405 | tmp16 |= (*buf8++) << 8; |
406 | writeword(base_addr, portno, tmp32); | 406 | writeword(base_addr, portno, tmp16); |
407 | } while (--length); | 407 | } while (--length); |
408 | } | 408 | } |
409 | 409 | ||
410 | static int | 410 | static u16 |
411 | readreg(struct net_device *dev, int regno) | 411 | readreg(struct net_device *dev, u16 regno) |
412 | { | 412 | { |
413 | writeword(dev->base_addr, ADD_PORT, regno); | 413 | writeword(dev->base_addr, ADD_PORT, regno); |
414 | return readword(dev->base_addr, DATA_PORT); | 414 | return readword(dev->base_addr, DATA_PORT); |
415 | } | 415 | } |
416 | 416 | ||
417 | static void | 417 | static void |
418 | writereg(struct net_device *dev, int regno, int value) | 418 | writereg(struct net_device *dev, u16 regno, u16 value) |
419 | { | 419 | { |
420 | writeword(dev->base_addr, ADD_PORT, regno); | 420 | writeword(dev->base_addr, ADD_PORT, regno); |
421 | writeword(dev->base_addr, DATA_PORT, value); | 421 | writeword(dev->base_addr, DATA_PORT, value); |