aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r--drivers/net/r8169.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
index 16a0ef1b1369..ae2a1f8f1454 100644
--- a/drivers/net/r8169.c
+++ b/drivers/net/r8169.c
@@ -1406,7 +1406,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1406 dev = alloc_etherdev(sizeof (*tp)); 1406 dev = alloc_etherdev(sizeof (*tp));
1407 if (dev == NULL) { 1407 if (dev == NULL) {
1408 if (netif_msg_drv(&debug)) 1408 if (netif_msg_drv(&debug))
1409 printk(KERN_ERR PFX "unable to alloc new ethernet\n"); 1409 dev_printk(KERN_ERR, &pdev->dev,
1410 "unable to alloc new ethernet\n");
1410 goto err_out; 1411 goto err_out;
1411 } 1412 }
1412 1413
@@ -1418,10 +1419,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1418 /* enable device (incl. PCI PM wakeup and hotplug setup) */ 1419 /* enable device (incl. PCI PM wakeup and hotplug setup) */
1419 rc = pci_enable_device(pdev); 1420 rc = pci_enable_device(pdev);
1420 if (rc < 0) { 1421 if (rc < 0) {
1421 if (netif_msg_probe(tp)) { 1422 if (netif_msg_probe(tp))
1422 printk(KERN_ERR PFX "%s: enable failure\n", 1423 dev_printk(KERN_ERR, &pdev->dev, "enable failure\n");
1423 pci_name(pdev));
1424 }
1425 goto err_out_free_dev; 1424 goto err_out_free_dev;
1426 } 1425 }
1427 1426
@@ -1437,37 +1436,33 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1437 pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command); 1436 pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);
1438 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK; 1437 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
1439 } else { 1438 } else {
1440 if (netif_msg_probe(tp)) { 1439 if (netif_msg_probe(tp))
1441 printk(KERN_ERR PFX 1440 dev_printk(KERN_ERR, &pdev->dev,
1442 "PowerManagement capability not found.\n"); 1441 "PowerManagement capability not found.\n");
1443 }
1444 } 1442 }
1445 1443
1446 /* make sure PCI base addr 1 is MMIO */ 1444 /* make sure PCI base addr 1 is MMIO */
1447 if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { 1445 if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
1448 if (netif_msg_probe(tp)) { 1446 if (netif_msg_probe(tp))
1449 printk(KERN_ERR PFX 1447 dev_printk(KERN_ERR, &pdev->dev,
1450 "region #1 not an MMIO resource, aborting\n"); 1448 "region #1 not an MMIO resource, aborting\n");
1451 }
1452 rc = -ENODEV; 1449 rc = -ENODEV;
1453 goto err_out_mwi; 1450 goto err_out_mwi;
1454 } 1451 }
1455 /* check for weird/broken PCI region reporting */ 1452 /* check for weird/broken PCI region reporting */
1456 if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) { 1453 if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
1457 if (netif_msg_probe(tp)) { 1454 if (netif_msg_probe(tp))
1458 printk(KERN_ERR PFX 1455 dev_printk(KERN_ERR, &pdev->dev,
1459 "Invalid PCI region size(s), aborting\n"); 1456 "Invalid PCI region size(s), aborting\n");
1460 }
1461 rc = -ENODEV; 1457 rc = -ENODEV;
1462 goto err_out_mwi; 1458 goto err_out_mwi;
1463 } 1459 }
1464 1460
1465 rc = pci_request_regions(pdev, MODULENAME); 1461 rc = pci_request_regions(pdev, MODULENAME);
1466 if (rc < 0) { 1462 if (rc < 0) {
1467 if (netif_msg_probe(tp)) { 1463 if (netif_msg_probe(tp))
1468 printk(KERN_ERR PFX "%s: could not request regions.\n", 1464 dev_printk(KERN_ERR, &pdev->dev,
1469 pci_name(pdev)); 1465 "could not request regions.\n");
1470 }
1471 goto err_out_mwi; 1466 goto err_out_mwi;
1472 } 1467 }
1473 1468
@@ -1480,10 +1475,9 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1480 } else { 1475 } else {
1481 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1476 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
1482 if (rc < 0) { 1477 if (rc < 0) {
1483 if (netif_msg_probe(tp)) { 1478 if (netif_msg_probe(tp))
1484 printk(KERN_ERR PFX 1479 dev_printk(KERN_ERR, &pdev->dev,
1485 "DMA configuration failed.\n"); 1480 "DMA configuration failed.\n");
1486 }
1487 goto err_out_free_res; 1481 goto err_out_free_res;
1488 } 1482 }
1489 } 1483 }
@@ -1494,7 +1488,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1494 ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE); 1488 ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
1495 if (ioaddr == NULL) { 1489 if (ioaddr == NULL) {
1496 if (netif_msg_probe(tp)) 1490 if (netif_msg_probe(tp))
1497 printk(KERN_ERR PFX "cannot remap MMIO, aborting\n"); 1491 dev_printk(KERN_ERR, &pdev->dev,
1492 "cannot remap MMIO, aborting\n");
1498 rc = -EIO; 1493 rc = -EIO;
1499 goto err_out_free_res; 1494 goto err_out_free_res;
1500 } 1495 }
@@ -1526,9 +1521,9 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1526 if (i < 0) { 1521 if (i < 0) {
1527 /* Unknown chip: assume array element #0, original RTL-8169 */ 1522 /* Unknown chip: assume array element #0, original RTL-8169 */
1528 if (netif_msg_probe(tp)) { 1523 if (netif_msg_probe(tp)) {
1529 printk(KERN_DEBUG PFX "PCI device %s: " 1524 dev_printk(KERN_DEBUG, &pdev->dev,
1530 "unknown chip version, assuming %s\n", 1525 "unknown chip version, assuming %s\n",
1531 pci_name(pdev), rtl_chip_info[0].name); 1526 rtl_chip_info[0].name);
1532 } 1527 }
1533 i++; 1528 i++;
1534 } 1529 }