summaryrefslogtreecommitdiff
path: root/drivers/net/r8169.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-06-27 10:47:51 -0400
committerJeff Garzik <jeff@garzik.org>2006-07-05 13:42:07 -0400
commit2e8a538d865de0eb9813c8a0f2284e920299c0cc (patch)
tree30b773865f17b6a2768171f62fdae9700b54ec44 /drivers/net/r8169.c
parentcabb7667dc150320ccd9d6f64fbd7a34766bc775 (diff)
[netdrvr] Use dev_printk() when ethernet interface isn't available
For messages prior to register_netdev(), prefer dev_printk() because that prints out both our driver name and our [PCI | whatever] bus id. Updates: 8139{cp,too}, b44, bnx2, cassini, {eepro,epic}100, fealnx, hamachi, ne2k-pci, ns83820, pci-skeleton, r8169. Signed-off-by: Jeff Garzik <jeff@garzik.org>
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,
dev = alloc_etherdev(sizeof (*tp));
if (dev == NULL) {
if (netif_msg_drv(&debug))
- printk(KERN_ERR PFX "unable to alloc new ethernet\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "unable to alloc new ethernet\n");
goto err_out;
}
@@ -1418,10 +1419,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
/* enable device (incl. PCI PM wakeup and hotplug setup) */
rc = pci_enable_device(pdev);
if (rc < 0) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX "%s: enable failure\n",
- pci_name(pdev));
- }
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev, "enable failure\n");
goto err_out_free_dev;
}
@@ -1437,37 +1436,33 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);
acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
} else {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
"PowerManagement capability not found.\n");
- }
}
/* make sure PCI base addr 1 is MMIO */
if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
"region #1 not an MMIO resource, aborting\n");
- }
rc = -ENODEV;
goto err_out_mwi;
}
/* check for weird/broken PCI region reporting */
if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
"Invalid PCI region size(s), aborting\n");
- }
rc = -ENODEV;
goto err_out_mwi;
}
rc = pci_request_regions(pdev, MODULENAME);
if (rc < 0) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX "%s: could not request regions.\n",
- pci_name(pdev));
- }
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
+ "could not request regions.\n");
goto err_out_mwi;
}
@@ -1480,10 +1475,9 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
} else {
rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (rc < 0) {
- if (netif_msg_probe(tp)) {
- printk(KERN_ERR PFX
+ if (netif_msg_probe(tp))
+ dev_printk(KERN_ERR, &pdev->dev,
"DMA configuration failed.\n");
- }
goto err_out_free_res;
}
}
@@ -1494,7 +1488,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
if (ioaddr == NULL) {
if (netif_msg_probe(tp))
- printk(KERN_ERR PFX "cannot remap MMIO, aborting\n");
+ dev_printk(KERN_ERR, &pdev->dev,
+ "cannot remap MMIO, aborting\n");
rc = -EIO;
goto err_out_free_res;
}
@@ -1526,9 +1521,9 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
if (i < 0) {
/* Unknown chip: assume array element #0, original RTL-8169 */
if (netif_msg_probe(tp)) {
- printk(KERN_DEBUG PFX "PCI device %s: "
+ dev_printk(KERN_DEBUG, &pdev->dev,
"unknown chip version, assuming %s\n",
- pci_name(pdev), rtl_chip_info[0].name);
+ rtl_chip_info[0].name);
}
i++;
}