diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-06-27 10:47:51 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-07-05 13:42:07 -0400 |
commit | 2e8a538d865de0eb9813c8a0f2284e920299c0cc (patch) | |
tree | 30b773865f17b6a2768171f62fdae9700b54ec44 /drivers/net/bnx2.c | |
parent | cabb7667dc150320ccd9d6f64fbd7a34766bc775 (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/bnx2.c')
-rw-r--r-- | drivers/net/bnx2.c | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 4f4db5ae503b..5502b9aeda53 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -5575,20 +5575,22 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5575 | /* enable device (incl. PCI PM wakeup), and bus-mastering */ | 5575 | /* enable device (incl. PCI PM wakeup), and bus-mastering */ |
5576 | rc = pci_enable_device(pdev); | 5576 | rc = pci_enable_device(pdev); |
5577 | if (rc) { | 5577 | if (rc) { |
5578 | printk(KERN_ERR PFX "Cannot enable PCI device, aborting."); | 5578 | dev_printk(KERN_ERR, &pdev->dev, |
5579 | "Cannot enable PCI device, aborting."); | ||
5579 | goto err_out; | 5580 | goto err_out; |
5580 | } | 5581 | } |
5581 | 5582 | ||
5582 | if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { | 5583 | if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { |
5583 | printk(KERN_ERR PFX "Cannot find PCI device base address, " | 5584 | dev_printk(KERN_ERR, &pdev->dev, |
5584 | "aborting.\n"); | 5585 | "Cannot find PCI device base address, aborting.\n"); |
5585 | rc = -ENODEV; | 5586 | rc = -ENODEV; |
5586 | goto err_out_disable; | 5587 | goto err_out_disable; |
5587 | } | 5588 | } |
5588 | 5589 | ||
5589 | rc = pci_request_regions(pdev, DRV_MODULE_NAME); | 5590 | rc = pci_request_regions(pdev, DRV_MODULE_NAME); |
5590 | if (rc) { | 5591 | if (rc) { |
5591 | printk(KERN_ERR PFX "Cannot obtain PCI resources, aborting.\n"); | 5592 | dev_printk(KERN_ERR, &pdev->dev, |
5593 | "Cannot obtain PCI resources, aborting.\n"); | ||
5592 | goto err_out_disable; | 5594 | goto err_out_disable; |
5593 | } | 5595 | } |
5594 | 5596 | ||
@@ -5596,15 +5598,16 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5596 | 5598 | ||
5597 | bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); | 5599 | bp->pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM); |
5598 | if (bp->pm_cap == 0) { | 5600 | if (bp->pm_cap == 0) { |
5599 | printk(KERN_ERR PFX "Cannot find power management capability, " | 5601 | dev_printk(KERN_ERR, &pdev->dev, |
5600 | "aborting.\n"); | 5602 | "Cannot find power management capability, aborting.\n"); |
5601 | rc = -EIO; | 5603 | rc = -EIO; |
5602 | goto err_out_release; | 5604 | goto err_out_release; |
5603 | } | 5605 | } |
5604 | 5606 | ||
5605 | bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX); | 5607 | bp->pcix_cap = pci_find_capability(pdev, PCI_CAP_ID_PCIX); |
5606 | if (bp->pcix_cap == 0) { | 5608 | if (bp->pcix_cap == 0) { |
5607 | printk(KERN_ERR PFX "Cannot find PCIX capability, aborting.\n"); | 5609 | dev_printk(KERN_ERR, &pdev->dev, |
5610 | "Cannot find PCIX capability, aborting.\n"); | ||
5608 | rc = -EIO; | 5611 | rc = -EIO; |
5609 | goto err_out_release; | 5612 | goto err_out_release; |
5610 | } | 5613 | } |
@@ -5612,14 +5615,15 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5612 | if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) { | 5615 | if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) { |
5613 | bp->flags |= USING_DAC_FLAG; | 5616 | bp->flags |= USING_DAC_FLAG; |
5614 | if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) { | 5617 | if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) { |
5615 | printk(KERN_ERR PFX "pci_set_consistent_dma_mask " | 5618 | dev_printk(KERN_ERR, &pdev->dev, |
5616 | "failed, aborting.\n"); | 5619 | "pci_set_consistent_dma_mask failed, aborting.\n"); |
5617 | rc = -EIO; | 5620 | rc = -EIO; |
5618 | goto err_out_release; | 5621 | goto err_out_release; |
5619 | } | 5622 | } |
5620 | } | 5623 | } |
5621 | else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) { | 5624 | else if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) { |
5622 | printk(KERN_ERR PFX "System does not support DMA, aborting.\n"); | 5625 | dev_printk(KERN_ERR, &pdev->dev, |
5626 | "System does not support DMA, aborting.\n"); | ||
5623 | rc = -EIO; | 5627 | rc = -EIO; |
5624 | goto err_out_release; | 5628 | goto err_out_release; |
5625 | } | 5629 | } |
@@ -5639,7 +5643,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5639 | bp->regview = ioremap_nocache(dev->base_addr, mem_len); | 5643 | bp->regview = ioremap_nocache(dev->base_addr, mem_len); |
5640 | 5644 | ||
5641 | if (!bp->regview) { | 5645 | if (!bp->regview) { |
5642 | printk(KERN_ERR PFX "Cannot map register space, aborting.\n"); | 5646 | dev_printk(KERN_ERR, &pdev->dev, |
5647 | "Cannot map register space, aborting.\n"); | ||
5643 | rc = -ENOMEM; | 5648 | rc = -ENOMEM; |
5644 | goto err_out_release; | 5649 | goto err_out_release; |
5645 | } | 5650 | } |
@@ -5711,8 +5716,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5711 | else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) && | 5716 | else if ((CHIP_ID(bp) == CHIP_ID_5706_A1) && |
5712 | !(bp->flags & PCIX_FLAG)) { | 5717 | !(bp->flags & PCIX_FLAG)) { |
5713 | 5718 | ||
5714 | printk(KERN_ERR PFX "5706 A1 can only be used in a PCIX bus, " | 5719 | dev_printk(KERN_ERR, &pdev->dev, |
5715 | "aborting.\n"); | 5720 | "5706 A1 can only be used in a PCIX bus, aborting.\n"); |
5716 | goto err_out_unmap; | 5721 | goto err_out_unmap; |
5717 | } | 5722 | } |
5718 | 5723 | ||
@@ -5733,7 +5738,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
5733 | 5738 | ||
5734 | if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) != | 5739 | if ((reg & BNX2_DEV_INFO_SIGNATURE_MAGIC_MASK) != |
5735 | BNX2_DEV_INFO_SIGNATURE_MAGIC) { | 5740 | BNX2_DEV_INFO_SIGNATURE_MAGIC) { |
5736 | printk(KERN_ERR PFX "Firmware not running, aborting.\n"); | 5741 | dev_printk(KERN_ERR, &pdev->dev, |
5742 | "Firmware not running, aborting.\n"); | ||
5737 | rc = -ENODEV; | 5743 | rc = -ENODEV; |
5738 | goto err_out_unmap; | 5744 | goto err_out_unmap; |
5739 | } | 5745 | } |
@@ -5895,7 +5901,8 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
5895 | #endif | 5901 | #endif |
5896 | 5902 | ||
5897 | if ((rc = register_netdev(dev))) { | 5903 | if ((rc = register_netdev(dev))) { |
5898 | printk(KERN_ERR PFX "Cannot register net device\n"); | 5904 | dev_printk(KERN_ERR, &pdev->dev, |
5905 | "Cannot register net device\n"); | ||
5899 | if (bp->regview) | 5906 | if (bp->regview) |
5900 | iounmap(bp->regview); | 5907 | iounmap(bp->regview); |
5901 | pci_release_regions(pdev); | 5908 | pci_release_regions(pdev); |