diff options
author | Joe Perches <joe@perches.com> | 2010-01-28 15:59:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-01 02:26:52 -0500 |
commit | f639dc7dadcbd97f1d666d5ffe00eab1ea3c0f6d (patch) | |
tree | 2004c48ded77e5f77e167d4f4b4ad464e5969cd9 /drivers/net/tulip | |
parent | 985a63ed3faf0faaba840d806f5ca4d360d13ad3 (diff) |
tulip/de2104x.c: Use dev_<level> and pr_<level>
Convert printks to dev_<level> where a dev is available
Convert printks to pr_<level> where not
Coalesce format strings
Change print formats with %d.dx to %0dx
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tulip')
-rw-r--r-- | drivers/net/tulip/de2104x.c | 138 |
1 files changed, 68 insertions, 70 deletions
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 87ea39e2037d..29330209ad8b 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c | |||
@@ -382,9 +382,9 @@ static void de_rx_err_acct (struct de_private *de, unsigned rx_tail, | |||
382 | /* Ingore earlier buffers. */ | 382 | /* Ingore earlier buffers. */ |
383 | if ((status & 0xffff) != 0x7fff) { | 383 | if ((status & 0xffff) != 0x7fff) { |
384 | if (netif_msg_rx_err(de)) | 384 | if (netif_msg_rx_err(de)) |
385 | printk(KERN_WARNING "%s: Oversized Ethernet frame " | 385 | dev_warn(&de->dev->dev, |
386 | "spanned multiple buffers, status %8.8x!\n", | 386 | "Oversized Ethernet frame spanned multiple buffers, status %08x!\n", |
387 | de->dev->name, status); | 387 | status); |
388 | de->net_stats.rx_length_errors++; | 388 | de->net_stats.rx_length_errors++; |
389 | } | 389 | } |
390 | } else if (status & RxError) { | 390 | } else if (status & RxError) { |
@@ -487,7 +487,7 @@ rx_next: | |||
487 | } | 487 | } |
488 | 488 | ||
489 | if (!rx_work) | 489 | if (!rx_work) |
490 | printk(KERN_WARNING "%s: rx work limit reached\n", de->dev->name); | 490 | dev_warn(&de->dev->dev, "rx work limit reached\n"); |
491 | 491 | ||
492 | de->rx_tail = rx_tail; | 492 | de->rx_tail = rx_tail; |
493 | } | 493 | } |
@@ -504,7 +504,8 @@ static irqreturn_t de_interrupt (int irq, void *dev_instance) | |||
504 | 504 | ||
505 | if (netif_msg_intr(de)) | 505 | if (netif_msg_intr(de)) |
506 | printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n", | 506 | printk(KERN_DEBUG "%s: intr, status %08x mode %08x desc %u/%u/%u\n", |
507 | dev->name, status, dr32(MacMode), de->rx_tail, de->tx_head, de->tx_tail); | 507 | dev->name, status, dr32(MacMode), |
508 | de->rx_tail, de->tx_head, de->tx_tail); | ||
508 | 509 | ||
509 | dw32(MacStatus, status); | 510 | dw32(MacStatus, status); |
510 | 511 | ||
@@ -529,8 +530,9 @@ static irqreturn_t de_interrupt (int irq, void *dev_instance) | |||
529 | 530 | ||
530 | pci_read_config_word(de->pdev, PCI_STATUS, &pci_status); | 531 | pci_read_config_word(de->pdev, PCI_STATUS, &pci_status); |
531 | pci_write_config_word(de->pdev, PCI_STATUS, pci_status); | 532 | pci_write_config_word(de->pdev, PCI_STATUS, pci_status); |
532 | printk(KERN_ERR "%s: PCI bus error, status=%08x, PCI status=%04x\n", | 533 | dev_err(&de->dev->dev, |
533 | dev->name, status, pci_status); | 534 | "PCI bus error, status=%08x, PCI status=%04x\n", |
535 | status, pci_status); | ||
534 | } | 536 | } |
535 | 537 | ||
536 | return IRQ_HANDLED; | 538 | return IRQ_HANDLED; |
@@ -582,7 +584,8 @@ static void de_tx (struct de_private *de) | |||
582 | de->net_stats.tx_packets++; | 584 | de->net_stats.tx_packets++; |
583 | de->net_stats.tx_bytes += skb->len; | 585 | de->net_stats.tx_bytes += skb->len; |
584 | if (netif_msg_tx_done(de)) | 586 | if (netif_msg_tx_done(de)) |
585 | printk(KERN_DEBUG "%s: tx done, slot %d\n", de->dev->name, tx_tail); | 587 | printk(KERN_DEBUG "%s: tx done, slot %d\n", |
588 | de->dev->name, tx_tail); | ||
586 | } | 589 | } |
587 | dev_kfree_skb_irq(skb); | 590 | dev_kfree_skb_irq(skb); |
588 | } | 591 | } |
@@ -870,7 +873,7 @@ static void de_stop_rxtx (struct de_private *de) | |||
870 | udelay(100); | 873 | udelay(100); |
871 | } | 874 | } |
872 | 875 | ||
873 | printk(KERN_WARNING "%s: timeout expired stopping DMA\n", de->dev->name); | 876 | dev_warn(&de->dev->dev, "timeout expired stopping DMA\n"); |
874 | } | 877 | } |
875 | 878 | ||
876 | static inline void de_start_rxtx (struct de_private *de) | 879 | static inline void de_start_rxtx (struct de_private *de) |
@@ -905,8 +908,8 @@ static void de_link_up(struct de_private *de) | |||
905 | if (!netif_carrier_ok(de->dev)) { | 908 | if (!netif_carrier_ok(de->dev)) { |
906 | netif_carrier_on(de->dev); | 909 | netif_carrier_on(de->dev); |
907 | if (netif_msg_link(de)) | 910 | if (netif_msg_link(de)) |
908 | printk(KERN_INFO "%s: link up, media %s\n", | 911 | dev_info(&de->dev->dev, "link up, media %s\n", |
909 | de->dev->name, media_name[de->media_type]); | 912 | media_name[de->media_type]); |
910 | } | 913 | } |
911 | } | 914 | } |
912 | 915 | ||
@@ -915,7 +918,7 @@ static void de_link_down(struct de_private *de) | |||
915 | if (netif_carrier_ok(de->dev)) { | 918 | if (netif_carrier_ok(de->dev)) { |
916 | netif_carrier_off(de->dev); | 919 | netif_carrier_off(de->dev); |
917 | if (netif_msg_link(de)) | 920 | if (netif_msg_link(de)) |
918 | printk(KERN_INFO "%s: link down\n", de->dev->name); | 921 | dev_info(&de->dev->dev, "link down\n"); |
919 | } | 922 | } |
920 | } | 923 | } |
921 | 924 | ||
@@ -925,7 +928,8 @@ static void de_set_media (struct de_private *de) | |||
925 | u32 macmode = dr32(MacMode); | 928 | u32 macmode = dr32(MacMode); |
926 | 929 | ||
927 | if (de_is_running(de)) | 930 | if (de_is_running(de)) |
928 | printk(KERN_WARNING "%s: chip is running while changing media!\n", de->dev->name); | 931 | dev_warn(&de->dev->dev, |
932 | "chip is running while changing media!\n"); | ||
929 | 933 | ||
930 | if (de->de21040) | 934 | if (de->de21040) |
931 | dw32(CSR11, FULL_DUPLEX_MAGIC); | 935 | dw32(CSR11, FULL_DUPLEX_MAGIC); |
@@ -945,15 +949,15 @@ static void de_set_media (struct de_private *de) | |||
945 | macmode &= ~FullDuplex; | 949 | macmode &= ~FullDuplex; |
946 | 950 | ||
947 | if (netif_msg_link(de)) { | 951 | if (netif_msg_link(de)) { |
948 | printk(KERN_INFO | 952 | dev_info(&de->dev->dev, "set link %s\n", media_name[media]); |
949 | "%s: set link %s\n" | 953 | dev_info(&de->dev->dev, "mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n", |
950 | "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" | 954 | dr32(MacMode), dr32(SIAStatus), |
951 | "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", | 955 | dr32(CSR13), dr32(CSR14), dr32(CSR15)); |
952 | de->dev->name, media_name[media], | 956 | |
953 | de->dev->name, dr32(MacMode), dr32(SIAStatus), | 957 | dev_info(&de->dev->dev, |
954 | dr32(CSR13), dr32(CSR14), dr32(CSR15), | 958 | "set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", |
955 | de->dev->name, macmode, de->media[media].csr13, | 959 | macmode, de->media[media].csr13, |
956 | de->media[media].csr14, de->media[media].csr15); | 960 | de->media[media].csr14, de->media[media].csr15); |
957 | } | 961 | } |
958 | if (macmode != dr32(MacMode)) | 962 | if (macmode != dr32(MacMode)) |
959 | dw32(MacMode, macmode); | 963 | dw32(MacMode, macmode); |
@@ -992,9 +996,8 @@ static void de21040_media_timer (unsigned long data) | |||
992 | de_link_up(de); | 996 | de_link_up(de); |
993 | else | 997 | else |
994 | if (netif_msg_timer(de)) | 998 | if (netif_msg_timer(de)) |
995 | printk(KERN_INFO "%s: %s link ok, status %x\n", | 999 | dev_info(&dev->dev, "%s link ok, status %x\n", |
996 | dev->name, media_name[de->media_type], | 1000 | media_name[de->media_type], status); |
997 | status); | ||
998 | return; | 1001 | return; |
999 | } | 1002 | } |
1000 | 1003 | ||
@@ -1022,8 +1025,8 @@ no_link_yet: | |||
1022 | add_timer(&de->media_timer); | 1025 | add_timer(&de->media_timer); |
1023 | 1026 | ||
1024 | if (netif_msg_timer(de)) | 1027 | if (netif_msg_timer(de)) |
1025 | printk(KERN_INFO "%s: no link, trying media %s, status %x\n", | 1028 | dev_info(&dev->dev, "no link, trying media %s, status %x\n", |
1026 | dev->name, media_name[de->media_type], status); | 1029 | media_name[de->media_type], status); |
1027 | } | 1030 | } |
1028 | 1031 | ||
1029 | static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media) | 1032 | static unsigned int de_ok_to_advertise (struct de_private *de, u32 new_media) |
@@ -1079,9 +1082,10 @@ static void de21041_media_timer (unsigned long data) | |||
1079 | de_link_up(de); | 1082 | de_link_up(de); |
1080 | else | 1083 | else |
1081 | if (netif_msg_timer(de)) | 1084 | if (netif_msg_timer(de)) |
1082 | printk(KERN_INFO "%s: %s link ok, mode %x status %x\n", | 1085 | dev_info(&dev->dev, |
1083 | dev->name, media_name[de->media_type], | 1086 | "%s link ok, mode %x status %x\n", |
1084 | dr32(MacMode), status); | 1087 | media_name[de->media_type], |
1088 | dr32(MacMode), status); | ||
1085 | return; | 1089 | return; |
1086 | } | 1090 | } |
1087 | 1091 | ||
@@ -1150,8 +1154,8 @@ no_link_yet: | |||
1150 | add_timer(&de->media_timer); | 1154 | add_timer(&de->media_timer); |
1151 | 1155 | ||
1152 | if (netif_msg_timer(de)) | 1156 | if (netif_msg_timer(de)) |
1153 | printk(KERN_INFO "%s: no link, trying media %s, status %x\n", | 1157 | dev_info(&dev->dev, "no link, trying media %s, status %x\n", |
1154 | dev->name, media_name[de->media_type], status); | 1158 | media_name[de->media_type], status); |
1155 | } | 1159 | } |
1156 | 1160 | ||
1157 | static void de_media_interrupt (struct de_private *de, u32 status) | 1161 | static void de_media_interrupt (struct de_private *de, u32 status) |
@@ -1378,8 +1382,7 @@ static int de_open (struct net_device *dev) | |||
1378 | 1382 | ||
1379 | rc = de_alloc_rings(de); | 1383 | rc = de_alloc_rings(de); |
1380 | if (rc) { | 1384 | if (rc) { |
1381 | printk(KERN_ERR "%s: ring allocation failure, err=%d\n", | 1385 | dev_err(&dev->dev, "ring allocation failure, err=%d\n", rc); |
1382 | dev->name, rc); | ||
1383 | return rc; | 1386 | return rc; |
1384 | } | 1387 | } |
1385 | 1388 | ||
@@ -1387,15 +1390,14 @@ static int de_open (struct net_device *dev) | |||
1387 | 1390 | ||
1388 | rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev); | 1391 | rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev); |
1389 | if (rc) { | 1392 | if (rc) { |
1390 | printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", | 1393 | dev_err(&dev->dev, "IRQ %d request failure, err=%d\n", |
1391 | dev->name, dev->irq, rc); | 1394 | dev->irq, rc); |
1392 | goto err_out_free; | 1395 | goto err_out_free; |
1393 | } | 1396 | } |
1394 | 1397 | ||
1395 | rc = de_init_hw(de); | 1398 | rc = de_init_hw(de); |
1396 | if (rc) { | 1399 | if (rc) { |
1397 | printk(KERN_ERR "%s: h/w init failure, err=%d\n", | 1400 | dev_err(&dev->dev, "h/w init failure, err=%d\n", rc); |
1398 | dev->name, rc); | ||
1399 | goto err_out_free_irq; | 1401 | goto err_out_free_irq; |
1400 | } | 1402 | } |
1401 | 1403 | ||
@@ -1666,8 +1668,8 @@ static int de_nway_reset(struct net_device *dev) | |||
1666 | status = dr32(SIAStatus); | 1668 | status = dr32(SIAStatus); |
1667 | dw32(SIAStatus, (status & ~NWayState) | NWayRestart); | 1669 | dw32(SIAStatus, (status & ~NWayState) | NWayRestart); |
1668 | if (netif_msg_link(de)) | 1670 | if (netif_msg_link(de)) |
1669 | printk(KERN_INFO "%s: link nway restart, status %x,%x\n", | 1671 | dev_info(&de->dev->dev, "link nway restart, status %x,%x\n", |
1670 | de->dev->name, status, dr32(SIAStatus)); | 1672 | status, dr32(SIAStatus)); |
1671 | return 0; | 1673 | return 0; |
1672 | } | 1674 | } |
1673 | 1675 | ||
@@ -1711,7 +1713,7 @@ static void __devinit de21040_get_mac_address (struct de_private *de) | |||
1711 | de->dev->dev_addr[i] = value; | 1713 | de->dev->dev_addr[i] = value; |
1712 | udelay(1); | 1714 | udelay(1); |
1713 | if (boguscnt <= 0) | 1715 | if (boguscnt <= 0) |
1714 | printk(KERN_WARNING PFX "timeout reading 21040 MAC address byte %u\n", i); | 1716 | pr_warning(PFX "timeout reading 21040 MAC address byte %u\n", i); |
1715 | } | 1717 | } |
1716 | } | 1718 | } |
1717 | 1719 | ||
@@ -1830,9 +1832,8 @@ static void __devinit de21041_get_srom_info (struct de_private *de) | |||
1830 | } | 1832 | } |
1831 | 1833 | ||
1832 | if (netif_msg_probe(de)) | 1834 | if (netif_msg_probe(de)) |
1833 | printk(KERN_INFO "de%d: SROM leaf offset %u, default media %s\n", | 1835 | pr_info("de%d: SROM leaf offset %u, default media %s\n", |
1834 | de->board_idx, ofs, | 1836 | de->board_idx, ofs, media_name[de->media_type]); |
1835 | media_name[de->media_type]); | ||
1836 | 1837 | ||
1837 | /* init SIA register values to defaults */ | 1838 | /* init SIA register values to defaults */ |
1838 | for (i = 0; i < DE_MAX_MEDIA; i++) { | 1839 | for (i = 0; i < DE_MAX_MEDIA; i++) { |
@@ -1879,9 +1880,9 @@ static void __devinit de21041_get_srom_info (struct de_private *de) | |||
1879 | de->media[idx].type = idx; | 1880 | de->media[idx].type = idx; |
1880 | 1881 | ||
1881 | if (netif_msg_probe(de)) | 1882 | if (netif_msg_probe(de)) |
1882 | printk(KERN_INFO "de%d: media block #%u: %s", | 1883 | pr_info("de%d: media block #%u: %s", |
1883 | de->board_idx, i, | 1884 | de->board_idx, i, |
1884 | media_name[de->media[idx].type]); | 1885 | media_name[de->media[idx].type]); |
1885 | 1886 | ||
1886 | bufp += sizeof (ib->opts); | 1887 | bufp += sizeof (ib->opts); |
1887 | 1888 | ||
@@ -1893,13 +1894,13 @@ static void __devinit de21041_get_srom_info (struct de_private *de) | |||
1893 | sizeof(ib->csr15); | 1894 | sizeof(ib->csr15); |
1894 | 1895 | ||
1895 | if (netif_msg_probe(de)) | 1896 | if (netif_msg_probe(de)) |
1896 | printk(" (%x,%x,%x)\n", | 1897 | pr_cont(" (%x,%x,%x)\n", |
1897 | de->media[idx].csr13, | 1898 | de->media[idx].csr13, |
1898 | de->media[idx].csr14, | 1899 | de->media[idx].csr14, |
1899 | de->media[idx].csr15); | 1900 | de->media[idx].csr15); |
1900 | 1901 | ||
1901 | } else if (netif_msg_probe(de)) | 1902 | } else if (netif_msg_probe(de)) |
1902 | printk("\n"); | 1903 | pr_cont("\n"); |
1903 | 1904 | ||
1904 | if (bufp > ((void *)&ee_data[DE_EEPROM_SIZE - 3])) | 1905 | if (bufp > ((void *)&ee_data[DE_EEPROM_SIZE - 3])) |
1905 | break; | 1906 | break; |
@@ -2005,7 +2006,7 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2005 | /* check for invalid IRQ value */ | 2006 | /* check for invalid IRQ value */ |
2006 | if (pdev->irq < 2) { | 2007 | if (pdev->irq < 2) { |
2007 | rc = -EIO; | 2008 | rc = -EIO; |
2008 | printk(KERN_ERR PFX "invalid irq (%d) for pci dev %s\n", | 2009 | pr_err(PFX "invalid irq (%d) for pci dev %s\n", |
2009 | pdev->irq, pci_name(pdev)); | 2010 | pdev->irq, pci_name(pdev)); |
2010 | goto err_out_res; | 2011 | goto err_out_res; |
2011 | } | 2012 | } |
@@ -2016,14 +2017,14 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2016 | pciaddr = pci_resource_start(pdev, 1); | 2017 | pciaddr = pci_resource_start(pdev, 1); |
2017 | if (!pciaddr) { | 2018 | if (!pciaddr) { |
2018 | rc = -EIO; | 2019 | rc = -EIO; |
2019 | printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n", | 2020 | pr_err(PFX "no MMIO resource for pci dev %s\n", pci_name(pdev)); |
2020 | pci_name(pdev)); | ||
2021 | goto err_out_res; | 2021 | goto err_out_res; |
2022 | } | 2022 | } |
2023 | if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) { | 2023 | if (pci_resource_len(pdev, 1) < DE_REGS_SIZE) { |
2024 | rc = -EIO; | 2024 | rc = -EIO; |
2025 | printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n", | 2025 | pr_err(PFX "MMIO resource (%llx) too small on pci dev %s\n", |
2026 | (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev)); | 2026 | (unsigned long long)pci_resource_len(pdev, 1), |
2027 | pci_name(pdev)); | ||
2027 | goto err_out_res; | 2028 | goto err_out_res; |
2028 | } | 2029 | } |
2029 | 2030 | ||
@@ -2031,9 +2032,9 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2031 | regs = ioremap_nocache(pciaddr, DE_REGS_SIZE); | 2032 | regs = ioremap_nocache(pciaddr, DE_REGS_SIZE); |
2032 | if (!regs) { | 2033 | if (!regs) { |
2033 | rc = -EIO; | 2034 | rc = -EIO; |
2034 | printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%lx) on pci dev %s\n", | 2035 | pr_err(PFX "Cannot map PCI MMIO (%llx@%lx) on pci dev %s\n", |
2035 | (unsigned long long)pci_resource_len(pdev, 1), | 2036 | (unsigned long long)pci_resource_len(pdev, 1), |
2036 | pciaddr, pci_name(pdev)); | 2037 | pciaddr, pci_name(pdev)); |
2037 | goto err_out_res; | 2038 | goto err_out_res; |
2038 | } | 2039 | } |
2039 | dev->base_addr = (unsigned long) regs; | 2040 | dev->base_addr = (unsigned long) regs; |
@@ -2044,8 +2045,7 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2044 | /* make sure hardware is not running */ | 2045 | /* make sure hardware is not running */ |
2045 | rc = de_reset_mac(de); | 2046 | rc = de_reset_mac(de); |
2046 | if (rc) { | 2047 | if (rc) { |
2047 | printk(KERN_ERR PFX "Cannot reset MAC, pci dev %s\n", | 2048 | pr_err(PFX "Cannot reset MAC, pci dev %s\n", pci_name(pdev)); |
2048 | pci_name(pdev)); | ||
2049 | goto err_out_iomap; | 2049 | goto err_out_iomap; |
2050 | } | 2050 | } |
2051 | 2051 | ||
@@ -2065,12 +2065,11 @@ static int __devinit de_init_one (struct pci_dev *pdev, | |||
2065 | goto err_out_iomap; | 2065 | goto err_out_iomap; |
2066 | 2066 | ||
2067 | /* print info about board and interface just registered */ | 2067 | /* print info about board and interface just registered */ |
2068 | printk (KERN_INFO "%s: %s at 0x%lx, %pM, IRQ %d\n", | 2068 | dev_info(&dev->dev, "%s at 0x%lx, %pM, IRQ %d\n", |
2069 | dev->name, | 2069 | de->de21040 ? "21040" : "21041", |
2070 | de->de21040 ? "21040" : "21041", | 2070 | dev->base_addr, |
2071 | dev->base_addr, | 2071 | dev->dev_addr, |
2072 | dev->dev_addr, | 2072 | dev->irq); |
2073 | dev->irq); | ||
2074 | 2073 | ||
2075 | pci_set_drvdata(pdev, dev); | 2074 | pci_set_drvdata(pdev, dev); |
2076 | 2075 | ||
@@ -2158,8 +2157,7 @@ static int de_resume (struct pci_dev *pdev) | |||
2158 | if (!netif_running(dev)) | 2157 | if (!netif_running(dev)) |
2159 | goto out_attach; | 2158 | goto out_attach; |
2160 | if ((retval = pci_enable_device(pdev))) { | 2159 | if ((retval = pci_enable_device(pdev))) { |
2161 | printk (KERN_ERR "%s: pci_enable_device failed in resume\n", | 2160 | dev_err(&dev->dev, "pci_enable_device failed in resume\n"); |
2162 | dev->name); | ||
2163 | goto out; | 2161 | goto out; |
2164 | } | 2162 | } |
2165 | de_init_hw(de); | 2163 | de_init_hw(de); |