diff options
author | Joe Perches <joe@perches.com> | 2010-08-12 08:22:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-18 17:26:30 -0400 |
commit | 636b8116d4e116eca1ac978f546b16fadfc15a6c (patch) | |
tree | 287364907b68208a473472e9f6314b64ced16d3d /drivers/net/pcmcia/3c574_cs.c | |
parent | 00093fab980d0a8950a64bdf9e346d0497b9a7e4 (diff) |
drivers/net/pcmcia: Use pr_<level> and netdev_<level>
On Mon, 2010-08-09 at 17:34 +0200, Dominik Brodowski wrote:
> look good from a PCMCIA point of view, therefore:
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
If PCMCIA is still being looked after, then here's
another for you, maybe for 2.6.37.
Use the more descriptive logging message styles.
There are whitespace/indentation errors in the original
sources that these changes do not modify, so checkpatch
errors were cheerfully ignored.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/pcmcia/3c574_cs.c')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 73 |
1 files changed, 35 insertions, 38 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 9a1840b67e78..9b319be7f1d2 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -69,6 +69,8 @@ earlier 3Com products. | |||
69 | 69 | ||
70 | */ | 70 | */ |
71 | 71 | ||
72 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
73 | |||
72 | #include <linux/module.h> | 74 | #include <linux/module.h> |
73 | #include <linux/kernel.h> | 75 | #include <linux/kernel.h> |
74 | #include <linux/init.h> | 76 | #include <linux/init.h> |
@@ -373,8 +375,8 @@ static int tc574_config(struct pcmcia_device *link) | |||
373 | for (i = 0; i < 3; i++) | 375 | for (i = 0; i < 3; i++) |
374 | phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); | 376 | phys_addr[i] = htons(read_eeprom(ioaddr, i + 10)); |
375 | if (phys_addr[0] == htons(0x6060)) { | 377 | if (phys_addr[0] == htons(0x6060)) { |
376 | printk(KERN_NOTICE "3c574_cs: IO port conflict at 0x%03lx" | 378 | pr_notice("IO port conflict at 0x%03lx-0x%03lx\n", |
377 | "-0x%03lx\n", dev->base_addr, dev->base_addr+15); | 379 | dev->base_addr, dev->base_addr+15); |
378 | goto failed; | 380 | goto failed; |
379 | } | 381 | } |
380 | } | 382 | } |
@@ -388,7 +390,7 @@ static int tc574_config(struct pcmcia_device *link) | |||
388 | outw(2<<11, ioaddr + RunnerRdCtrl); | 390 | outw(2<<11, ioaddr + RunnerRdCtrl); |
389 | mcr = inb(ioaddr + 2); | 391 | mcr = inb(ioaddr + 2); |
390 | outw(0<<11, ioaddr + RunnerRdCtrl); | 392 | outw(0<<11, ioaddr + RunnerRdCtrl); |
391 | printk(KERN_INFO " ASIC rev %d,", mcr>>3); | 393 | pr_info(" ASIC rev %d,", mcr>>3); |
392 | EL3WINDOW(3); | 394 | EL3WINDOW(3); |
393 | config = inl(ioaddr + Wn3_Config); | 395 | config = inl(ioaddr + Wn3_Config); |
394 | lp->default_media = (config & Xcvr) >> Xcvr_shift; | 396 | lp->default_media = (config & Xcvr) >> Xcvr_shift; |
@@ -425,7 +427,7 @@ static int tc574_config(struct pcmcia_device *link) | |||
425 | } | 427 | } |
426 | } | 428 | } |
427 | if (phy > 32) { | 429 | if (phy > 32) { |
428 | printk(KERN_NOTICE " No MII transceivers found!\n"); | 430 | pr_notice(" No MII transceivers found!\n"); |
429 | goto failed; | 431 | goto failed; |
430 | } | 432 | } |
431 | i = mdio_read(ioaddr, lp->phys, 16) | 0x40; | 433 | i = mdio_read(ioaddr, lp->phys, 16) | 0x40; |
@@ -441,18 +443,16 @@ static int tc574_config(struct pcmcia_device *link) | |||
441 | SET_NETDEV_DEV(dev, &link->dev); | 443 | SET_NETDEV_DEV(dev, &link->dev); |
442 | 444 | ||
443 | if (register_netdev(dev) != 0) { | 445 | if (register_netdev(dev) != 0) { |
444 | printk(KERN_NOTICE "3c574_cs: register_netdev() failed\n"); | 446 | pr_notice("register_netdev() failed\n"); |
445 | goto failed; | 447 | goto failed; |
446 | } | 448 | } |
447 | 449 | ||
448 | printk(KERN_INFO "%s: %s at io %#3lx, irq %d, " | 450 | netdev_info(dev, "%s at io %#3lx, irq %d, hw_addr %pM\n", |
449 | "hw_addr %pM.\n", | 451 | cardname, dev->base_addr, dev->irq, dev->dev_addr); |
450 | dev->name, cardname, dev->base_addr, dev->irq, | 452 | netdev_info(dev, " %dK FIFO split %s Rx:Tx, %sMII interface.\n", |
451 | dev->dev_addr); | 453 | 8 << config & Ram_size, |
452 | printk(" %dK FIFO split %s Rx:Tx, %sMII interface.\n", | 454 | ram_split[(config & Ram_split) >> Ram_split_shift], |
453 | 8 << config & Ram_size, | 455 | config & Autoselect ? "autoselect " : ""); |
454 | ram_split[(config & Ram_split) >> Ram_split_shift], | ||
455 | config & Autoselect ? "autoselect " : ""); | ||
456 | 456 | ||
457 | return 0; | 457 | return 0; |
458 | 458 | ||
@@ -499,14 +499,14 @@ static void dump_status(struct net_device *dev) | |||
499 | { | 499 | { |
500 | unsigned int ioaddr = dev->base_addr; | 500 | unsigned int ioaddr = dev->base_addr; |
501 | EL3WINDOW(1); | 501 | EL3WINDOW(1); |
502 | printk(KERN_INFO " irq status %04x, rx status %04x, tx status " | 502 | netdev_info(dev, " irq status %04x, rx status %04x, tx status %02x, tx free %04x\n", |
503 | "%02x, tx free %04x\n", inw(ioaddr+EL3_STATUS), | 503 | inw(ioaddr+EL3_STATUS), |
504 | inw(ioaddr+RxStatus), inb(ioaddr+TxStatus), | 504 | inw(ioaddr+RxStatus), inb(ioaddr+TxStatus), |
505 | inw(ioaddr+TxFree)); | 505 | inw(ioaddr+TxFree)); |
506 | EL3WINDOW(4); | 506 | EL3WINDOW(4); |
507 | printk(KERN_INFO " diagnostics: fifo %04x net %04x ethernet %04x" | 507 | netdev_info(dev, " diagnostics: fifo %04x net %04x ethernet %04x media %04x\n", |
508 | " media %04x\n", inw(ioaddr+0x04), inw(ioaddr+0x06), | 508 | inw(ioaddr+0x04), inw(ioaddr+0x06), |
509 | inw(ioaddr+0x08), inw(ioaddr+0x0a)); | 509 | inw(ioaddr+0x08), inw(ioaddr+0x0a)); |
510 | EL3WINDOW(1); | 510 | EL3WINDOW(1); |
511 | } | 511 | } |
512 | 512 | ||
@@ -520,7 +520,7 @@ static void tc574_wait_for_completion(struct net_device *dev, int cmd) | |||
520 | while (--i > 0) | 520 | while (--i > 0) |
521 | if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break; | 521 | if (!(inw(dev->base_addr + EL3_STATUS) & 0x1000)) break; |
522 | if (i == 0) | 522 | if (i == 0) |
523 | printk(KERN_NOTICE "%s: command 0x%04x did not complete!\n", dev->name, cmd); | 523 | netdev_notice(dev, "command 0x%04x did not complete!\n", cmd); |
524 | } | 524 | } |
525 | 525 | ||
526 | /* Read a word from the EEPROM using the regular EEPROM access register. | 526 | /* Read a word from the EEPROM using the regular EEPROM access register. |
@@ -722,7 +722,7 @@ static void el3_tx_timeout(struct net_device *dev) | |||
722 | { | 722 | { |
723 | unsigned int ioaddr = dev->base_addr; | 723 | unsigned int ioaddr = dev->base_addr; |
724 | 724 | ||
725 | printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); | 725 | netdev_notice(dev, "Transmit timed out!\n"); |
726 | dump_status(dev); | 726 | dump_status(dev); |
727 | dev->stats.tx_errors++; | 727 | dev->stats.tx_errors++; |
728 | dev->trans_start = jiffies; /* prevent tx timeout */ | 728 | dev->trans_start = jiffies; /* prevent tx timeout */ |
@@ -845,8 +845,8 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id) | |||
845 | EL3WINDOW(4); | 845 | EL3WINDOW(4); |
846 | fifo_diag = inw(ioaddr + Wn4_FIFODiag); | 846 | fifo_diag = inw(ioaddr + Wn4_FIFODiag); |
847 | EL3WINDOW(1); | 847 | EL3WINDOW(1); |
848 | printk(KERN_NOTICE "%s: adapter failure, FIFO diagnostic" | 848 | netdev_notice(dev, "adapter failure, FIFO diagnostic register %04x\n", |
849 | " register %04x.\n", dev->name, fifo_diag); | 849 | fifo_diag); |
850 | if (fifo_diag & 0x0400) { | 850 | if (fifo_diag & 0x0400) { |
851 | /* Tx overrun */ | 851 | /* Tx overrun */ |
852 | tc574_wait_for_completion(dev, TxReset); | 852 | tc574_wait_for_completion(dev, TxReset); |
@@ -900,7 +900,7 @@ static void media_check(unsigned long arg) | |||
900 | this, we can limp along even if the interrupt is blocked */ | 900 | this, we can limp along even if the interrupt is blocked */ |
901 | if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) { | 901 | if ((inw(ioaddr + EL3_STATUS) & IntLatch) && (inb(ioaddr + Timer) == 0xff)) { |
902 | if (!lp->fast_poll) | 902 | if (!lp->fast_poll) |
903 | printk(KERN_INFO "%s: interrupt(s) dropped!\n", dev->name); | 903 | netdev_info(dev, "interrupt(s) dropped!\n"); |
904 | 904 | ||
905 | local_irq_save(flags); | 905 | local_irq_save(flags); |
906 | el3_interrupt(dev->irq, dev); | 906 | el3_interrupt(dev->irq, dev); |
@@ -923,23 +923,21 @@ static void media_check(unsigned long arg) | |||
923 | 923 | ||
924 | if (media != lp->media_status) { | 924 | if (media != lp->media_status) { |
925 | if ((media ^ lp->media_status) & 0x0004) | 925 | if ((media ^ lp->media_status) & 0x0004) |
926 | printk(KERN_INFO "%s: %s link beat\n", dev->name, | 926 | netdev_info(dev, "%s link beat\n", |
927 | (lp->media_status & 0x0004) ? "lost" : "found"); | 927 | (lp->media_status & 0x0004) ? "lost" : "found"); |
928 | if ((media ^ lp->media_status) & 0x0020) { | 928 | if ((media ^ lp->media_status) & 0x0020) { |
929 | lp->partner = 0; | 929 | lp->partner = 0; |
930 | if (lp->media_status & 0x0020) { | 930 | if (lp->media_status & 0x0020) { |
931 | printk(KERN_INFO "%s: autonegotiation restarted\n", | 931 | netdev_info(dev, "autonegotiation restarted\n"); |
932 | dev->name); | ||
933 | } else if (partner) { | 932 | } else if (partner) { |
934 | partner &= lp->advertising; | 933 | partner &= lp->advertising; |
935 | lp->partner = partner; | 934 | lp->partner = partner; |
936 | printk(KERN_INFO "%s: autonegotiation complete: " | 935 | netdev_info(dev, "autonegotiation complete: " |
937 | "%sbaseT-%cD selected\n", dev->name, | 936 | "%dbaseT-%cD selected\n", |
938 | ((partner & 0x0180) ? "100" : "10"), | 937 | (partner & 0x0180) ? 100 : 10, |
939 | ((partner & 0x0140) ? 'F' : 'H')); | 938 | (partner & 0x0140) ? 'F' : 'H'); |
940 | } else { | 939 | } else { |
941 | printk(KERN_INFO "%s: link partner did not autonegotiate\n", | 940 | netdev_info(dev, "link partner did not autonegotiate\n"); |
942 | dev->name); | ||
943 | } | 941 | } |
944 | 942 | ||
945 | EL3WINDOW(3); | 943 | EL3WINDOW(3); |
@@ -949,10 +947,9 @@ static void media_check(unsigned long arg) | |||
949 | 947 | ||
950 | } | 948 | } |
951 | if (media & 0x0010) | 949 | if (media & 0x0010) |
952 | printk(KERN_INFO "%s: remote fault detected\n", | 950 | netdev_info(dev, "remote fault detected\n"); |
953 | dev->name); | ||
954 | if (media & 0x0002) | 951 | if (media & 0x0002) |
955 | printk(KERN_INFO "%s: jabber detected\n", dev->name); | 952 | netdev_info(dev, "jabber detected\n"); |
956 | lp->media_status = media; | 953 | lp->media_status = media; |
957 | } | 954 | } |
958 | spin_unlock_irqrestore(&lp->window_lock, flags); | 955 | spin_unlock_irqrestore(&lp->window_lock, flags); |