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/8139too.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/8139too.c')
-rw-r--r-- | drivers/net/8139too.c | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index 717506b2b13..5e9ef52a5ca 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -768,7 +768,8 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, | |||
768 | /* dev and priv zeroed in alloc_etherdev */ | 768 | /* dev and priv zeroed in alloc_etherdev */ |
769 | dev = alloc_etherdev (sizeof (*tp)); | 769 | dev = alloc_etherdev (sizeof (*tp)); |
770 | if (dev == NULL) { | 770 | if (dev == NULL) { |
771 | printk (KERN_ERR PFX "%s: Unable to alloc new net device\n", pci_name(pdev)); | 771 | dev_printk (KERN_ERR, &pdev->dev, |
772 | "Unable to alloc new net device\n"); | ||
772 | return -ENOMEM; | 773 | return -ENOMEM; |
773 | } | 774 | } |
774 | SET_MODULE_OWNER(dev); | 775 | SET_MODULE_OWNER(dev); |
@@ -800,31 +801,35 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, | |||
800 | #ifdef USE_IO_OPS | 801 | #ifdef USE_IO_OPS |
801 | /* make sure PCI base addr 0 is PIO */ | 802 | /* make sure PCI base addr 0 is PIO */ |
802 | if (!(pio_flags & IORESOURCE_IO)) { | 803 | if (!(pio_flags & IORESOURCE_IO)) { |
803 | printk (KERN_ERR PFX "%s: region #0 not a PIO resource, aborting\n", pci_name(pdev)); | 804 | dev_printk (KERN_ERR, &pdev->dev, |
805 | "region #0 not a PIO resource, aborting\n"); | ||
804 | rc = -ENODEV; | 806 | rc = -ENODEV; |
805 | goto err_out; | 807 | goto err_out; |
806 | } | 808 | } |
807 | /* check for weird/broken PCI region reporting */ | 809 | /* check for weird/broken PCI region reporting */ |
808 | if (pio_len < RTL_MIN_IO_SIZE) { | 810 | if (pio_len < RTL_MIN_IO_SIZE) { |
809 | printk (KERN_ERR PFX "%s: Invalid PCI I/O region size(s), aborting\n", pci_name(pdev)); | 811 | dev_printk (KERN_ERR, &pdev->dev, |
812 | "Invalid PCI I/O region size(s), aborting\n"); | ||
810 | rc = -ENODEV; | 813 | rc = -ENODEV; |
811 | goto err_out; | 814 | goto err_out; |
812 | } | 815 | } |
813 | #else | 816 | #else |
814 | /* make sure PCI base addr 1 is MMIO */ | 817 | /* make sure PCI base addr 1 is MMIO */ |
815 | if (!(mmio_flags & IORESOURCE_MEM)) { | 818 | if (!(mmio_flags & IORESOURCE_MEM)) { |
816 | printk (KERN_ERR PFX "%s: region #1 not an MMIO resource, aborting\n", pci_name(pdev)); | 819 | dev_printk (KERN_ERR, &pdev->dev, |
820 | "region #1 not an MMIO resource, aborting\n"); | ||
817 | rc = -ENODEV; | 821 | rc = -ENODEV; |
818 | goto err_out; | 822 | goto err_out; |
819 | } | 823 | } |
820 | if (mmio_len < RTL_MIN_IO_SIZE) { | 824 | if (mmio_len < RTL_MIN_IO_SIZE) { |
821 | printk (KERN_ERR PFX "%s: Invalid PCI mem region size(s), aborting\n", pci_name(pdev)); | 825 | dev_printk (KERN_ERR, &pdev->dev, |
826 | "Invalid PCI mem region size(s), aborting\n"); | ||
822 | rc = -ENODEV; | 827 | rc = -ENODEV; |
823 | goto err_out; | 828 | goto err_out; |
824 | } | 829 | } |
825 | #endif | 830 | #endif |
826 | 831 | ||
827 | rc = pci_request_regions (pdev, "8139too"); | 832 | rc = pci_request_regions (pdev, DRV_NAME); |
828 | if (rc) | 833 | if (rc) |
829 | goto err_out; | 834 | goto err_out; |
830 | disable_dev_on_err = 1; | 835 | disable_dev_on_err = 1; |
@@ -835,7 +840,7 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, | |||
835 | #ifdef USE_IO_OPS | 840 | #ifdef USE_IO_OPS |
836 | ioaddr = ioport_map(pio_start, pio_len); | 841 | ioaddr = ioport_map(pio_start, pio_len); |
837 | if (!ioaddr) { | 842 | if (!ioaddr) { |
838 | printk (KERN_ERR PFX "%s: cannot map PIO, aborting\n", pci_name(pdev)); | 843 | dev_printk (KERN_ERR, &pdev->dev, "cannot map PIO, aborting\n"); |
839 | rc = -EIO; | 844 | rc = -EIO; |
840 | goto err_out; | 845 | goto err_out; |
841 | } | 846 | } |
@@ -846,7 +851,8 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, | |||
846 | /* ioremap MMIO region */ | 851 | /* ioremap MMIO region */ |
847 | ioaddr = pci_iomap(pdev, 1, 0); | 852 | ioaddr = pci_iomap(pdev, 1, 0); |
848 | if (ioaddr == NULL) { | 853 | if (ioaddr == NULL) { |
849 | printk (KERN_ERR PFX "%s: cannot remap MMIO, aborting\n", pci_name(pdev)); | 854 | dev_printk (KERN_ERR, &pdev->dev, |
855 | "cannot remap MMIO, aborting\n"); | ||
850 | rc = -EIO; | 856 | rc = -EIO; |
851 | goto err_out; | 857 | goto err_out; |
852 | } | 858 | } |
@@ -860,8 +866,8 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, | |||
860 | 866 | ||
861 | /* check for missing/broken hardware */ | 867 | /* check for missing/broken hardware */ |
862 | if (RTL_R32 (TxConfig) == 0xFFFFFFFF) { | 868 | if (RTL_R32 (TxConfig) == 0xFFFFFFFF) { |
863 | printk (KERN_ERR PFX "%s: Chip not responding, ignoring board\n", | 869 | dev_printk (KERN_ERR, &pdev->dev, |
864 | pci_name(pdev)); | 870 | "Chip not responding, ignoring board\n"); |
865 | rc = -EIO; | 871 | rc = -EIO; |
866 | goto err_out; | 872 | goto err_out; |
867 | } | 873 | } |
@@ -875,9 +881,10 @@ static int __devinit rtl8139_init_board (struct pci_dev *pdev, | |||
875 | } | 881 | } |
876 | 882 | ||
877 | /* if unknown chip, assume array element #0, original RTL-8139 in this case */ | 883 | /* if unknown chip, assume array element #0, original RTL-8139 in this case */ |
878 | printk (KERN_DEBUG PFX "%s: unknown chip version, assuming RTL-8139\n", | 884 | dev_printk (KERN_DEBUG, &pdev->dev, |
879 | pci_name(pdev)); | 885 | "unknown chip version, assuming RTL-8139\n"); |
880 | printk (KERN_DEBUG PFX "%s: TxConfig = 0x%lx\n", pci_name(pdev), RTL_R32 (TxConfig)); | 886 | dev_printk (KERN_DEBUG, &pdev->dev, |
887 | "TxConfig = 0x%lx\n", RTL_R32 (TxConfig)); | ||
881 | tp->chipset = 0; | 888 | tp->chipset = 0; |
882 | 889 | ||
883 | match: | 890 | match: |
@@ -954,9 +961,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
954 | 961 | ||
955 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 962 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
956 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) { | 963 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) { |
957 | printk(KERN_INFO PFX "pci dev %s (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", | 964 | dev_printk(KERN_INFO, &pdev->dev, |
958 | pci_name(pdev), pdev->vendor, pdev->device, pci_rev); | 965 | "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", |
959 | printk(KERN_INFO PFX "Use the \"8139cp\" driver for improved performance and stability.\n"); | 966 | pdev->vendor, pdev->device, pci_rev); |
967 | dev_printk(KERN_INFO, &pdev->dev, | ||
968 | "Use the \"8139cp\" driver for improved performance and stability.\n"); | ||
960 | } | 969 | } |
961 | 970 | ||
962 | i = rtl8139_init_board (pdev, &dev); | 971 | i = rtl8139_init_board (pdev, &dev); |