From 2e8a538d865de0eb9813c8a0f2284e920299c0cc Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Tue, 27 Jun 2006 10:47:51 -0400 Subject: [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 --- drivers/net/ne2k-pci.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/net/ne2k-pci.c') diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c index fa50eb88940..4f226064d55 100644 --- a/drivers/net/ne2k-pci.c +++ b/drivers/net/ne2k-pci.c @@ -231,12 +231,14 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, irq = pdev->irq; if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) { - printk (KERN_ERR PFX "no I/O resource at PCI BAR #0\n"); + dev_printk (KERN_ERR, &pdev->dev, + "no I/O resource at PCI BAR #0\n"); return -ENODEV; } if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) { - printk (KERN_ERR PFX "I/O resource 0x%x @ 0x%lx busy\n", + dev_printk (KERN_ERR, &pdev->dev, + "I/O resource 0x%x @ 0x%lx busy\n", NE_IO_EXTENT, ioaddr); return -EBUSY; } @@ -263,7 +265,8 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, /* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */ dev = alloc_ei_netdev(); if (!dev) { - printk (KERN_ERR PFX "cannot allocate ethernet device\n"); + dev_printk (KERN_ERR, &pdev->dev, + "cannot allocate ethernet device\n"); goto err_out_free_res; } SET_MODULE_OWNER(dev); @@ -281,7 +284,8 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev, while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0) /* Limit wait: '2' avoids jiffy roll-over. */ if (jiffies - reset_start_time > 2) { - printk(KERN_ERR PFX "Card failure (no reset ack).\n"); + dev_printk(KERN_ERR, &pdev->dev, + "Card failure (no reset ack).\n"); goto err_out_free_netdev; } -- cgit v1.2.3