aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/8139cp.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/8139cp.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/8139cp.c')
-rw-r--r--drivers/net/8139cp.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 1959654cbec8..93b7c904bba9 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1836,9 +1836,11 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1836 1836
1837 if (pdev->vendor == PCI_VENDOR_ID_REALTEK && 1837 if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
1838 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) { 1838 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) {
1839 printk(KERN_ERR PFX "pci dev %s (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", 1839 dev_printk(KERN_ERR, &pdev->dev,
1840 pci_name(pdev), pdev->vendor, pdev->device, pci_rev); 1840 "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n",
1841 printk(KERN_ERR PFX "Try the \"8139too\" driver instead.\n"); 1841 pdev->vendor, pdev->device, pci_rev);
1842 dev_printk(KERN_ERR, &pdev->dev,
1843 "Try the \"8139too\" driver instead.\n");
1842 return -ENODEV; 1844 return -ENODEV;
1843 } 1845 }
1844 1846
@@ -1876,14 +1878,14 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1876 pciaddr = pci_resource_start(pdev, 1); 1878 pciaddr = pci_resource_start(pdev, 1);
1877 if (!pciaddr) { 1879 if (!pciaddr) {
1878 rc = -EIO; 1880 rc = -EIO;
1879 printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n", 1881 dev_printk(KERN_ERR, &pdev->dev, "no MMIO resource\n");
1880 pci_name(pdev));
1881 goto err_out_res; 1882 goto err_out_res;
1882 } 1883 }
1883 if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) { 1884 if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) {
1884 rc = -EIO; 1885 rc = -EIO;
1885 printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n", 1886 dev_printk(KERN_ERR, &pdev->dev,
1886 (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev)); 1887 "MMIO resource (%llx) too small\n",
1888 (unsigned long long)pci_resource_len(pdev, 1));
1887 goto err_out_res; 1889 goto err_out_res;
1888 } 1890 }
1889 1891
@@ -1897,14 +1899,15 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1897 1899
1898 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1900 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
1899 if (rc) { 1901 if (rc) {
1900 printk(KERN_ERR PFX "No usable DMA configuration, " 1902 dev_printk(KERN_ERR, &pdev->dev,
1901 "aborting.\n"); 1903 "No usable DMA configuration, aborting.\n");
1902 goto err_out_res; 1904 goto err_out_res;
1903 } 1905 }
1904 rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); 1906 rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
1905 if (rc) { 1907 if (rc) {
1906 printk(KERN_ERR PFX "No usable consistent DMA configuration, " 1908 dev_printk(KERN_ERR, &pdev->dev,
1907 "aborting.\n"); 1909 "No usable consistent DMA configuration, "
1910 "aborting.\n");
1908 goto err_out_res; 1911 goto err_out_res;
1909 } 1912 }
1910 } 1913 }
@@ -1915,9 +1918,10 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1915 regs = ioremap(pciaddr, CP_REGS_SIZE); 1918 regs = ioremap(pciaddr, CP_REGS_SIZE);
1916 if (!regs) { 1919 if (!regs) {
1917 rc = -EIO; 1920 rc = -EIO;
1918 printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%llx) on pci dev %s\n", 1921 dev_printk(KERN_ERR, &pdev->dev,
1919 (unsigned long long)pci_resource_len(pdev, 1), 1922 "Cannot map PCI MMIO (%llx@%llx)\n",
1920 (unsigned long long)pciaddr, pci_name(pdev)); 1923 (unsigned long long)pci_resource_len(pdev, 1),
1924 (unsigned long long)pciaddr);
1921 goto err_out_res; 1925 goto err_out_res;
1922 } 1926 }
1923 dev->base_addr = (unsigned long) regs; 1927 dev->base_addr = (unsigned long) regs;
@@ -1986,7 +1990,8 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
1986 /* enable busmastering and memory-write-invalidate */ 1990 /* enable busmastering and memory-write-invalidate */
1987 pci_set_master(pdev); 1991 pci_set_master(pdev);
1988 1992
1989 if (cp->wol_enabled) cp_set_d3_state (cp); 1993 if (cp->wol_enabled)
1994 cp_set_d3_state (cp);
1990 1995
1991 return 0; 1996 return 0;
1992 1997
@@ -2011,7 +2016,8 @@ static void cp_remove_one (struct pci_dev *pdev)
2011 BUG_ON(!dev); 2016 BUG_ON(!dev);
2012 unregister_netdev(dev); 2017 unregister_netdev(dev);
2013 iounmap(cp->regs); 2018 iounmap(cp->regs);
2014 if (cp->wol_enabled) pci_set_power_state (pdev, PCI_D0); 2019 if (cp->wol_enabled)
2020 pci_set_power_state (pdev, PCI_D0);
2015 pci_release_regions(pdev); 2021 pci_release_regions(pdev);
2016 pci_clear_mwi(pdev); 2022 pci_clear_mwi(pdev);
2017 pci_disable_device(pdev); 2023 pci_disable_device(pdev);