Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tulip_core: Use dev_<level> and pr_<level>

Convert printks to dev_<level> where appropriate
Convert printks to pr_<level>
Change print formats with %d.dx to %0dx
Coalesce long formats

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Joe Perches and committed by
David S. Miller
d60bec4e 57dbb2d8

+83 -81
+83 -81
drivers/net/tulip/tulip_core.c
··· 41 41 static char version[] __devinitdata = 42 42 "Linux Tulip driver version " DRV_VERSION " (" DRV_RELDATE ")\n"; 43 43 44 - 45 44 /* A few user-configurable values. */ 46 45 47 46 /* Maximum events (Rx packets, etc.) to handle at each interrupt. */ ··· 325 326 udelay(100); 326 327 327 328 if (tulip_debug > 1) 328 - printk(KERN_DEBUG "%s: tulip_up(), irq==%d.\n", dev->name, dev->irq); 329 + printk(KERN_DEBUG "%s: tulip_up(), irq==%d\n", 330 + dev->name, dev->irq); 329 331 330 332 iowrite32(tp->rx_ring_dma, ioaddr + CSR3); 331 333 iowrite32(tp->tx_ring_dma, ioaddr + CSR4); ··· 387 387 (dev->if_port == 12 ? 0 : dev->if_port); 388 388 for (i = 0; i < tp->mtable->leafcount; i++) 389 389 if (tp->mtable->mleaf[i].media == looking_for) { 390 - printk(KERN_INFO "%s: Using user-specified media %s.\n", 391 - dev->name, medianame[dev->if_port]); 390 + dev_info(&dev->dev, 391 + "Using user-specified media %s\n", 392 + medianame[dev->if_port]); 392 393 goto media_picked; 393 394 } 394 395 } ··· 397 396 int looking_for = tp->mtable->defaultmedia & MEDIA_MASK; 398 397 for (i = 0; i < tp->mtable->leafcount; i++) 399 398 if (tp->mtable->mleaf[i].media == looking_for) { 400 - printk(KERN_INFO "%s: Using EEPROM-set media %s.\n", 401 - dev->name, medianame[looking_for]); 399 + dev_info(&dev->dev, 400 + "Using EEPROM-set media %s\n", 401 + medianame[looking_for]); 402 402 goto media_picked; 403 403 } 404 404 } ··· 426 424 if (tp->mii_cnt) { 427 425 tulip_select_media(dev, 1); 428 426 if (tulip_debug > 1) 429 - printk(KERN_INFO "%s: Using MII transceiver %d, status " 430 - "%4.4x.\n", 431 - dev->name, tp->phys[0], tulip_mdio_read(dev, tp->phys[0], 1)); 427 + dev_info(&dev->dev, 428 + "Using MII transceiver %d, status %04x\n", 429 + tp->phys[0], 430 + tulip_mdio_read(dev, tp->phys[0], 1)); 432 431 iowrite32(csr6_mask_defstate, ioaddr + CSR6); 433 432 tp->csr6 = csr6_mask_hdcap; 434 433 dev->if_port = 11; ··· 493 490 iowrite32(0, ioaddr + CSR2); /* Rx poll demand */ 494 491 495 492 if (tulip_debug > 2) { 496 - printk(KERN_DEBUG "%s: Done tulip_up(), CSR0 %8.8x, CSR5 %8.8x CSR6 %8.8x.\n", 497 - dev->name, ioread32(ioaddr + CSR0), ioread32(ioaddr + CSR5), 498 - ioread32(ioaddr + CSR6)); 493 + printk(KERN_DEBUG "%s: Done tulip_up(), CSR0 %08x, CSR5 %08x CSR6 %08x\n", 494 + dev->name, ioread32(ioaddr + CSR0), 495 + ioread32(ioaddr + CSR5), 496 + ioread32(ioaddr + CSR6)); 499 497 } 500 498 501 499 /* Set the timer to switch to check for link beat and perhaps switch ··· 544 540 if (tulip_media_cap[dev->if_port] & MediaIsMII) { 545 541 /* Do nothing -- the media monitor should handle this. */ 546 542 if (tulip_debug > 1) 547 - printk(KERN_WARNING "%s: Transmit timeout using MII device.\n", 548 - dev->name); 543 + dev_warn(&dev->dev, 544 + "Transmit timeout using MII device\n"); 549 545 } else if (tp->chip_id == DC21140 || tp->chip_id == DC21142 || 550 546 tp->chip_id == MX98713 || tp->chip_id == COMPEX9881 || 551 547 tp->chip_id == DM910X) { 552 - printk(KERN_WARNING "%s: 21140 transmit timed out, status %8.8x, " 553 - "SIA %8.8x %8.8x %8.8x %8.8x, resetting...\n", 554 - dev->name, ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12), 555 - ioread32(ioaddr + CSR13), ioread32(ioaddr + CSR14), ioread32(ioaddr + CSR15)); 548 + dev_warn(&dev->dev, 549 + "21140 transmit timed out, status %08x, SIA %08x %08x %08x %08x, resetting...\n", 550 + ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12), 551 + ioread32(ioaddr + CSR13), ioread32(ioaddr + CSR14), 552 + ioread32(ioaddr + CSR15)); 556 553 tp->timeout_recovery = 1; 557 554 schedule_work(&tp->media_work); 558 555 goto out_unlock; 559 556 } else if (tp->chip_id == PNIC2) { 560 - printk(KERN_WARNING "%s: PNIC2 transmit timed out, status %8.8x, " 561 - "CSR6/7 %8.8x / %8.8x CSR12 %8.8x, resetting...\n", 562 - dev->name, (int)ioread32(ioaddr + CSR5), (int)ioread32(ioaddr + CSR6), 563 - (int)ioread32(ioaddr + CSR7), (int)ioread32(ioaddr + CSR12)); 557 + dev_warn(&dev->dev, 558 + "PNIC2 transmit timed out, status %08x, CSR6/7 %08x / %08x CSR12 %08x, resetting...\n", 559 + (int)ioread32(ioaddr + CSR5), 560 + (int)ioread32(ioaddr + CSR6), 561 + (int)ioread32(ioaddr + CSR7), 562 + (int)ioread32(ioaddr + CSR12)); 564 563 } else { 565 - printk(KERN_WARNING "%s: Transmit timed out, status %8.8x, CSR12 " 566 - "%8.8x, resetting...\n", 567 - dev->name, ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12)); 564 + dev_warn(&dev->dev, 565 + "Transmit timed out, status %08x, CSR12 %08x, resetting...\n", 566 + ioread32(ioaddr + CSR5), ioread32(ioaddr + CSR12)); 568 567 dev->if_port = 0; 569 568 } 570 569 ··· 577 570 for (i = 0; i < RX_RING_SIZE; i++) { 578 571 u8 *buf = (u8 *)(tp->rx_ring[i].buffer1); 579 572 int j; 580 - printk(KERN_DEBUG "%2d: %8.8x %8.8x %8.8x %8.8x " 581 - "%2.2x %2.2x %2.2x.\n", 582 - i, (unsigned int)tp->rx_ring[i].status, 583 - (unsigned int)tp->rx_ring[i].length, 584 - (unsigned int)tp->rx_ring[i].buffer1, 585 - (unsigned int)tp->rx_ring[i].buffer2, 586 - buf[0], buf[1], buf[2]); 573 + printk(KERN_DEBUG 574 + "%2d: %08x %08x %08x %08x %02x %02x %02x\n", 575 + i, 576 + (unsigned int)tp->rx_ring[i].status, 577 + (unsigned int)tp->rx_ring[i].length, 578 + (unsigned int)tp->rx_ring[i].buffer1, 579 + (unsigned int)tp->rx_ring[i].buffer2, 580 + buf[0], buf[1], buf[2]); 587 581 for (j = 0; buf[j] != 0xee && j < 1600; j++) 588 582 if (j < 100) 589 - printk(KERN_CONT " %2.2x", buf[j]); 590 - printk(KERN_CONT " j=%d.\n", j); 583 + pr_cont(" %02x", buf[j]); 584 + pr_cont(" j=%d\n", j); 591 585 } 592 - printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); 586 + printk(KERN_DEBUG " Rx ring %08x: ", (int)tp->rx_ring); 593 587 for (i = 0; i < RX_RING_SIZE; i++) 594 - printk(KERN_CONT " %8.8x", 595 - (unsigned int)tp->rx_ring[i].status); 596 - printk(KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring); 588 + pr_cont(" %08x", (unsigned int)tp->rx_ring[i].status); 589 + printk(KERN_DEBUG " Tx ring %08x: ", (int)tp->tx_ring); 597 590 for (i = 0; i < TX_RING_SIZE; i++) 598 - printk(KERN_CONT " %8.8x", (unsigned int)tp->tx_ring[i].status); 599 - printk(KERN_CONT "\n"); 591 + pr_cont(" %08x", (unsigned int)tp->tx_ring[i].status); 592 + pr_cont("\n"); 600 593 } 601 594 #endif 602 595 ··· 839 832 tulip_down (dev); 840 833 841 834 if (tulip_debug > 1) 842 - printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n", 843 - dev->name, ioread32 (ioaddr + CSR5)); 835 + dev_printk(KERN_DEBUG, &dev->dev, 836 + "Shutting down ethercard, status was %02x\n", 837 + ioread32 (ioaddr + CSR5)); 844 838 845 839 free_irq (dev->irq, dev); 846 840 ··· 1081 1073 filterbit &= 0x3f; 1082 1074 mc_filter[filterbit >> 5] |= 1 << (filterbit & 31); 1083 1075 if (tulip_debug > 2) 1084 - printk(KERN_INFO "%s: Added filter for %pM" 1085 - " %8.8x bit %d.\n", 1086 - dev->name, mclist->dmi_addr, 1087 - ether_crc(ETH_ALEN, mclist->dmi_addr), filterbit); 1076 + dev_info(&dev->dev, 1077 + "Added filter for %pM %08x bit %d\n", 1078 + mclist->dmi_addr, 1079 + ether_crc(ETH_ALEN, mclist->dmi_addr), filterbit); 1088 1080 } 1089 1081 if (mc_filter[0] == tp->mc_filter[0] && 1090 1082 mc_filter[1] == tp->mc_filter[1]) ··· 1296 1288 unsigned int force_csr0 = 0; 1297 1289 1298 1290 #ifndef MODULE 1299 - static int did_version; /* Already printed version info. */ 1300 - if (tulip_debug > 0 && did_version++ == 0) 1301 - printk (KERN_INFO "%s", version); 1291 + if (tulip_debug > 0) 1292 + printk_once(KERN_INFO "%s", version); 1302 1293 #endif 1303 1294 1304 1295 board_idx++; ··· 1308 1301 */ 1309 1302 1310 1303 if (pdev->subsystem_vendor == PCI_VENDOR_ID_LMC) { 1311 - printk (KERN_ERR PFX "skipping LMC card.\n"); 1304 + pr_err(PFX "skipping LMC card\n"); 1312 1305 return -ENODEV; 1313 1306 } 1314 1307 ··· 1324 1317 1325 1318 if (pdev->vendor == 0x1282 && pdev->device == 0x9100 && 1326 1319 pdev->revision < 0x30) { 1327 - printk(KERN_INFO PFX 1328 - "skipping early DM9100 with Crc bug (use dmfe)\n"); 1320 + pr_info(PFX "skipping early DM9100 with Crc bug (use dmfe)\n"); 1329 1321 return -ENODEV; 1330 1322 } 1331 1323 1332 1324 dp = pci_device_to_OF_node(pdev); 1333 1325 if (!(dp && of_get_property(dp, "local-mac-address", NULL))) { 1334 - printk(KERN_INFO PFX 1335 - "skipping DM910x expansion card (use dmfe)\n"); 1326 + pr_info(PFX "skipping DM910x expansion card (use dmfe)\n"); 1336 1327 return -ENODEV; 1337 1328 } 1338 1329 } ··· 1377 1372 1378 1373 i = pci_enable_device(pdev); 1379 1374 if (i) { 1380 - printk (KERN_ERR PFX 1381 - "Cannot enable tulip board #%d, aborting\n", 1382 - board_idx); 1375 + pr_err(PFX "Cannot enable tulip board #%d, aborting\n", 1376 + board_idx); 1383 1377 return i; 1384 1378 } 1385 1379 ··· 1387 1383 /* alloc_etherdev ensures aligned and zeroed private structures */ 1388 1384 dev = alloc_etherdev (sizeof (*tp)); 1389 1385 if (!dev) { 1390 - printk (KERN_ERR PFX "ether device alloc failed, aborting\n"); 1386 + pr_err(PFX "ether device alloc failed, aborting\n"); 1391 1387 return -ENOMEM; 1392 1388 } 1393 1389 1394 1390 SET_NETDEV_DEV(dev, &pdev->dev); 1395 1391 if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) { 1396 - printk (KERN_ERR PFX "%s: I/O region (0x%llx@0x%llx) too small, " 1397 - "aborting\n", pci_name(pdev), 1398 - (unsigned long long)pci_resource_len (pdev, 0), 1399 - (unsigned long long)pci_resource_start (pdev, 0)); 1392 + pr_err(PFX "%s: I/O region (0x%llx@0x%llx) too small, aborting\n", 1393 + pci_name(pdev), 1394 + (unsigned long long)pci_resource_len (pdev, 0), 1395 + (unsigned long long)pci_resource_start (pdev, 0)); 1400 1396 goto err_out_free_netdev; 1401 1397 } 1402 1398 1403 1399 /* grab all resources from both PIO and MMIO regions, as we 1404 1400 * don't want anyone else messing around with our hardware */ 1405 - if (pci_request_regions (pdev, "tulip")) 1401 + if (pci_request_regions (pdev, DRV_NAME)) 1406 1402 goto err_out_free_netdev; 1407 1403 1408 1404 ioaddr = pci_iomap(pdev, TULIP_BAR, tulip_tbl[chip_idx].io_size); ··· 1615 1611 if (dev->mem_start & MEDIA_MASK) 1616 1612 tp->default_port = dev->mem_start & MEDIA_MASK; 1617 1613 if (tp->default_port) { 1618 - printk(KERN_INFO "tulip%d: Transceiver selection forced to %s.\n", 1619 - board_idx, medianame[tp->default_port & MEDIA_MASK]); 1614 + pr_info(DRV_NAME "%d: Transceiver selection forced to %s\n", 1615 + board_idx, medianame[tp->default_port & MEDIA_MASK]); 1620 1616 tp->medialock = 1; 1621 1617 if (tulip_media_cap[tp->default_port] & MediaAlwaysFD) 1622 1618 tp->full_duplex = 1; ··· 1631 1627 } 1632 1628 1633 1629 if (tp->flags & HAS_MEDIA_TABLE) { 1634 - sprintf(dev->name, "tulip%d", board_idx); /* hack */ 1630 + sprintf(dev->name, DRV_NAME "%d", board_idx); /* hack */ 1635 1631 tulip_parse_eeprom(dev); 1636 1632 strcpy(dev->name, "eth%d"); /* un-hack */ 1637 1633 } ··· 1667 1663 if (register_netdev(dev)) 1668 1664 goto err_out_free_ring; 1669 1665 1670 - printk(KERN_INFO "%s: %s rev %d at " 1671 - #ifdef CONFIG_TULIP_MMIO 1672 - "MMIO" 1673 - #else 1674 - "Port" 1675 - #endif 1676 - " %#llx,", dev->name, chip_name, pdev->revision, 1677 - (unsigned long long) pci_resource_start(pdev, TULIP_BAR)); 1678 1666 pci_set_drvdata(pdev, dev); 1679 1667 1680 - if (eeprom_missing) 1681 - printk(" EEPROM not present,"); 1682 - printk(" %pM", dev->dev_addr); 1683 - printk(", IRQ %d.\n", irq); 1668 + dev_info(&dev->dev, 1669 + #ifdef CONFIG_TULIP_MMIO 1670 + "%s rev %d at MMIO %#llx,%s %pM, IRQ %d\n", 1671 + #else 1672 + "%s rev %d at Port %#llx,%s %pM, IRQ %d\n", 1673 + #endif 1674 + chip_name, pdev->revision, 1675 + (unsigned long long)pci_resource_start(pdev, TULIP_BAR), 1676 + eeprom_missing ? " EEPROM not present," : "", 1677 + dev->dev_addr, irq); 1684 1678 1685 1679 if (tp->chip_id == PNIC2) 1686 1680 tp->link_change = pnic2_lnk_change; ··· 1801 1799 return 0; 1802 1800 1803 1801 if ((retval = pci_enable_device(pdev))) { 1804 - printk (KERN_ERR "tulip: pci_enable_device failed in resume\n"); 1802 + pr_err(PFX "pci_enable_device failed in resume\n"); 1805 1803 return retval; 1806 1804 } 1807 1805 1808 1806 if ((retval = request_irq(dev->irq, tulip_interrupt, IRQF_SHARED, dev->name, dev))) { 1809 - printk (KERN_ERR "tulip: request_irq failed in resume\n"); 1807 + pr_err(PFX "request_irq failed in resume\n"); 1810 1808 return retval; 1811 1809 } 1812 1810 ··· 1876 1874 static int __init tulip_init (void) 1877 1875 { 1878 1876 #ifdef MODULE 1879 - printk (KERN_INFO "%s", version); 1877 + pr_info("%s", version); 1880 1878 #endif 1881 1879 1882 1880 /* copy module parms into globals */