aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/8139cp.c38
-rw-r--r--drivers/net/8139too.c41
-rw-r--r--drivers/net/b44.c28
-rw-r--r--drivers/net/bnx2.c37
-rw-r--r--drivers/net/cassini.c20
-rw-r--r--drivers/net/eepro100.c8
-rw-r--r--drivers/net/epic100.c23
-rw-r--r--drivers/net/fealnx.c17
-rw-r--r--drivers/net/hamachi.c3
-rw-r--r--drivers/net/ne2k-pci.c12
-rw-r--r--drivers/net/ns83820.c14
-rw-r--r--drivers/net/pci-skeleton.c24
-rw-r--r--drivers/net/r8169.c43
13 files changed, 173 insertions, 135 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);
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c
index 717506b2b13a..5e9ef52a5ca9 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
883match: 890match:
@@ -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);
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index cd98d31dee8c..5815e3dc1251 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -2120,13 +2120,14 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2120 2120
2121 err = pci_enable_device(pdev); 2121 err = pci_enable_device(pdev);
2122 if (err) { 2122 if (err) {
2123 printk(KERN_ERR PFX "Cannot enable PCI device, " 2123 dev_printk(KERN_ERR, &pdev->dev, "Cannot enable PCI device, "
2124 "aborting.\n"); 2124 "aborting.\n");
2125 return err; 2125 return err;
2126 } 2126 }
2127 2127
2128 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { 2128 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
2129 printk(KERN_ERR PFX "Cannot find proper PCI device " 2129 dev_printk(KERN_ERR, &pdev->dev,
2130 "Cannot find proper PCI device "
2130 "base address, aborting.\n"); 2131 "base address, aborting.\n");
2131 err = -ENODEV; 2132 err = -ENODEV;
2132 goto err_out_disable_pdev; 2133 goto err_out_disable_pdev;
@@ -2134,8 +2135,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2134 2135
2135 err = pci_request_regions(pdev, DRV_MODULE_NAME); 2136 err = pci_request_regions(pdev, DRV_MODULE_NAME);
2136 if (err) { 2137 if (err) {
2137 printk(KERN_ERR PFX "Cannot obtain PCI resources, " 2138 dev_printk(KERN_ERR, &pdev->dev,
2138 "aborting.\n"); 2139 "Cannot obtain PCI resources, aborting.\n");
2139 goto err_out_disable_pdev; 2140 goto err_out_disable_pdev;
2140 } 2141 }
2141 2142
@@ -2143,15 +2144,15 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2143 2144
2144 err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK); 2145 err = pci_set_dma_mask(pdev, (u64) B44_DMA_MASK);
2145 if (err) { 2146 if (err) {
2146 printk(KERN_ERR PFX "No usable DMA configuration, " 2147 dev_printk(KERN_ERR, &pdev->dev,
2147 "aborting.\n"); 2148 "No usable DMA configuration, aborting.\n");
2148 goto err_out_free_res; 2149 goto err_out_free_res;
2149 } 2150 }
2150 2151
2151 err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK); 2152 err = pci_set_consistent_dma_mask(pdev, (u64) B44_DMA_MASK);
2152 if (err) { 2153 if (err) {
2153 printk(KERN_ERR PFX "No usable DMA configuration, " 2154 dev_printk(KERN_ERR, &pdev->dev,
2154 "aborting.\n"); 2155 "No usable DMA configuration, aborting.\n");
2155 goto err_out_free_res; 2156 goto err_out_free_res;
2156 } 2157 }
2157 2158
@@ -2160,7 +2161,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2160 2161
2161 dev = alloc_etherdev(sizeof(*bp)); 2162 dev = alloc_etherdev(sizeof(*bp));
2162 if (!dev) { 2163 if (!dev) {
2163 printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); 2164 dev_printk(KERN_ERR, &pdev->dev,
2165 "Etherdev alloc failed, aborting.\n");
2164 err = -ENOMEM; 2166 err = -ENOMEM;
2165 goto err_out_free_res; 2167 goto err_out_free_res;
2166 } 2168 }
@@ -2181,7 +2183,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2181 2183
2182 bp->regs = ioremap(b44reg_base, b44reg_len); 2184 bp->regs = ioremap(b44reg_base, b44reg_len);
2183 if (bp->regs == 0UL) { 2185 if (bp->regs == 0UL) {
2184 printk(KERN_ERR PFX "Cannot map device registers, " 2186 dev_printk(KERN_ERR, &pdev->dev, "Cannot map device registers, "
2185 "aborting.\n"); 2187 "aborting.\n");
2186 err = -ENOMEM; 2188 err = -ENOMEM;
2187 goto err_out_free_dev; 2189 goto err_out_free_dev;
@@ -2212,8 +2214,8 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2212 2214
2213 err = b44_get_invariants(bp); 2215 err = b44_get_invariants(bp);
2214 if (err) { 2216 if (err) {
2215 printk(KERN_ERR PFX "Problem fetching invariants of chip, " 2217 dev_printk(KERN_ERR, &pdev->dev,
2216 "aborting.\n"); 2218 "Problem fetching invariants of chip, aborting.\n");
2217 goto err_out_iounmap; 2219 goto err_out_iounmap;
2218 } 2220 }
2219 2221
@@ -2233,7 +2235,7 @@ static int __devinit b44_init_one(struct pci_dev *pdev,
2233 2235
2234 err = register_netdev(dev); 2236 err = register_netdev(dev);
2235 if (err) { 2237 if (err) {
2236 printk(KERN_ERR PFX "Cannot register net device, " 2238 dev_printk(KERN_ERR, &pdev->dev, "Cannot register net device, "
2237 "aborting.\n"); 2239 "aborting.\n");
2238 goto err_out_iounmap; 2240 goto err_out_iounmap;
2239 } 2241 }
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);
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c
index d33130f64700..428e2067738c 100644
--- a/drivers/net/cassini.c
+++ b/drivers/net/cassini.c
@@ -4887,13 +4887,13 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4887 4887
4888 err = pci_enable_device(pdev); 4888 err = pci_enable_device(pdev);
4889 if (err) { 4889 if (err) {
4890 printk(KERN_ERR PFX "Cannot enable PCI device, " 4890 dev_printk(KERN_ERR, &pdev->dev, "Cannot enable PCI device, "
4891 "aborting.\n"); 4891 "aborting.\n");
4892 return err; 4892 return err;
4893 } 4893 }
4894 4894
4895 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) { 4895 if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
4896 printk(KERN_ERR PFX "Cannot find proper PCI device " 4896 dev_printk(KERN_ERR, &pdev->dev, "Cannot find proper PCI device "
4897 "base address, aborting.\n"); 4897 "base address, aborting.\n");
4898 err = -ENODEV; 4898 err = -ENODEV;
4899 goto err_out_disable_pdev; 4899 goto err_out_disable_pdev;
@@ -4901,7 +4901,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4901 4901
4902 dev = alloc_etherdev(sizeof(*cp)); 4902 dev = alloc_etherdev(sizeof(*cp));
4903 if (!dev) { 4903 if (!dev) {
4904 printk(KERN_ERR PFX "Etherdev alloc failed, aborting.\n"); 4904 dev_printk(KERN_ERR, &pdev->dev, "Etherdev alloc failed, aborting.\n");
4905 err = -ENOMEM; 4905 err = -ENOMEM;
4906 goto err_out_disable_pdev; 4906 goto err_out_disable_pdev;
4907 } 4907 }
@@ -4910,7 +4910,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4910 4910
4911 err = pci_request_regions(pdev, dev->name); 4911 err = pci_request_regions(pdev, dev->name);
4912 if (err) { 4912 if (err) {
4913 printk(KERN_ERR PFX "Cannot obtain PCI resources, " 4913 dev_printk(KERN_ERR, &pdev->dev, "Cannot obtain PCI resources, "
4914 "aborting.\n"); 4914 "aborting.\n");
4915 goto err_out_free_netdev; 4915 goto err_out_free_netdev;
4916 } 4916 }
@@ -4941,7 +4941,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4941 if (pci_write_config_byte(pdev, 4941 if (pci_write_config_byte(pdev,
4942 PCI_CACHE_LINE_SIZE, 4942 PCI_CACHE_LINE_SIZE,
4943 cas_cacheline_size)) { 4943 cas_cacheline_size)) {
4944 printk(KERN_ERR PFX "Could not set PCI cache " 4944 dev_printk(KERN_ERR, &pdev->dev, "Could not set PCI cache "
4945 "line size\n"); 4945 "line size\n");
4946 goto err_write_cacheline; 4946 goto err_write_cacheline;
4947 } 4947 }
@@ -4955,7 +4955,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4955 err = pci_set_consistent_dma_mask(pdev, 4955 err = pci_set_consistent_dma_mask(pdev,
4956 DMA_64BIT_MASK); 4956 DMA_64BIT_MASK);
4957 if (err < 0) { 4957 if (err < 0) {
4958 printk(KERN_ERR PFX "Unable to obtain 64-bit DMA " 4958 dev_printk(KERN_ERR, &pdev->dev, "Unable to obtain 64-bit DMA "
4959 "for consistent allocations\n"); 4959 "for consistent allocations\n");
4960 goto err_out_free_res; 4960 goto err_out_free_res;
4961 } 4961 }
@@ -4963,7 +4963,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
4963 } else { 4963 } else {
4964 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 4964 err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
4965 if (err) { 4965 if (err) {
4966 printk(KERN_ERR PFX "No usable DMA configuration, " 4966 dev_printk(KERN_ERR, &pdev->dev, "No usable DMA configuration, "
4967 "aborting.\n"); 4967 "aborting.\n");
4968 goto err_out_free_res; 4968 goto err_out_free_res;
4969 } 4969 }
@@ -5023,7 +5023,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
5023 /* give us access to cassini registers */ 5023 /* give us access to cassini registers */
5024 cp->regs = pci_iomap(pdev, 0, casreg_len); 5024 cp->regs = pci_iomap(pdev, 0, casreg_len);
5025 if (cp->regs == 0UL) { 5025 if (cp->regs == 0UL) {
5026 printk(KERN_ERR PFX "Cannot map device registers, " 5026 dev_printk(KERN_ERR, &pdev->dev, "Cannot map device registers, "
5027 "aborting.\n"); 5027 "aborting.\n");
5028 goto err_out_free_res; 5028 goto err_out_free_res;
5029 } 5029 }
@@ -5040,7 +5040,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
5040 pci_alloc_consistent(pdev, sizeof(struct cas_init_block), 5040 pci_alloc_consistent(pdev, sizeof(struct cas_init_block),
5041 &cp->block_dvma); 5041 &cp->block_dvma);
5042 if (!cp->init_block) { 5042 if (!cp->init_block) {
5043 printk(KERN_ERR PFX "Cannot allocate init block, " 5043 dev_printk(KERN_ERR, &pdev->dev, "Cannot allocate init block, "
5044 "aborting.\n"); 5044 "aborting.\n");
5045 goto err_out_iounmap; 5045 goto err_out_iounmap;
5046 } 5046 }
@@ -5085,7 +5085,7 @@ static int __devinit cas_init_one(struct pci_dev *pdev,
5085 dev->features |= NETIF_F_HIGHDMA; 5085 dev->features |= NETIF_F_HIGHDMA;
5086 5086
5087 if (register_netdev(dev)) { 5087 if (register_netdev(dev)) {
5088 printk(KERN_ERR PFX "Cannot register net device, " 5088 dev_printk(KERN_ERR, &pdev->dev, "Cannot register net device, "
5089 "aborting.\n"); 5089 "aborting.\n");
5090 goto err_out_free_consistent; 5090 goto err_out_free_consistent;
5091 } 5091 }
diff --git a/drivers/net/eepro100.c b/drivers/net/eepro100.c
index 2ad327542927..bccb12e03c2d 100644
--- a/drivers/net/eepro100.c
+++ b/drivers/net/eepro100.c
@@ -555,12 +555,14 @@ static int __devinit eepro100_init_one (struct pci_dev *pdev,
555 555
556 if (!request_region(pci_resource_start(pdev, 1), 556 if (!request_region(pci_resource_start(pdev, 1),
557 pci_resource_len(pdev, 1), "eepro100")) { 557 pci_resource_len(pdev, 1), "eepro100")) {
558 printk (KERN_ERR "eepro100: cannot reserve I/O ports\n"); 558 dev_printk (KERN_ERR, &pdev->dev,
559 "eepro100: cannot reserve I/O ports\n");
559 goto err_out_none; 560 goto err_out_none;
560 } 561 }
561 if (!request_mem_region(pci_resource_start(pdev, 0), 562 if (!request_mem_region(pci_resource_start(pdev, 0),
562 pci_resource_len(pdev, 0), "eepro100")) { 563 pci_resource_len(pdev, 0), "eepro100")) {
563 printk (KERN_ERR "eepro100: cannot reserve MMIO region\n"); 564 dev_printk (KERN_ERR, &pdev->dev,
565 "eepro100: cannot reserve MMIO region\n");
564 goto err_out_free_pio_region; 566 goto err_out_free_pio_region;
565 } 567 }
566 568
@@ -573,7 +575,7 @@ static int __devinit eepro100_init_one (struct pci_dev *pdev,
573 575
574 ioaddr = pci_iomap(pdev, pci_bar, 0); 576 ioaddr = pci_iomap(pdev, pci_bar, 0);
575 if (!ioaddr) { 577 if (!ioaddr) {
576 printk (KERN_ERR "eepro100: cannot remap IO\n"); 578 dev_printk (KERN_ERR, &pdev->dev, "eepro100: cannot remap IO\n");
577 goto err_out_free_mmio_region; 579 goto err_out_free_mmio_region;
578 } 580 }
579 581
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index 05c9a26a74e2..6dd0e9d159de 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -422,8 +422,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
422 ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4)); 422 ((u16 *)dev->dev_addr)[i] = le16_to_cpu(inw(ioaddr + LAN0 + i*4));
423 423
424 if (debug > 2) { 424 if (debug > 2) {
425 printk(KERN_DEBUG DRV_NAME "(%s): EEPROM contents\n", 425 dev_printk(KERN_DEBUG, &pdev->dev, "EEPROM contents:\n");
426 pci_name(pdev));
427 for (i = 0; i < 64; i++) 426 for (i = 0; i < 64; i++)
428 printk(" %4.4x%s", read_eeprom(ioaddr, i), 427 printk(" %4.4x%s", read_eeprom(ioaddr, i),
429 i % 16 == 15 ? "\n" : ""); 428 i % 16 == 15 ? "\n" : "");
@@ -445,21 +444,23 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
445 int mii_status = mdio_read(dev, phy, MII_BMSR); 444 int mii_status = mdio_read(dev, phy, MII_BMSR);
446 if (mii_status != 0xffff && mii_status != 0x0000) { 445 if (mii_status != 0xffff && mii_status != 0x0000) {
447 ep->phys[phy_idx++] = phy; 446 ep->phys[phy_idx++] = phy;
448 printk(KERN_INFO DRV_NAME "(%s): MII transceiver #%d control " 447 dev_printk(KERN_INFO, &pdev->dev,
449 "%4.4x status %4.4x.\n", 448 "MII transceiver #%d control "
450 pci_name(pdev), phy, mdio_read(dev, phy, 0), mii_status); 449 "%4.4x status %4.4x.\n",
450 phy, mdio_read(dev, phy, 0), mii_status);
451 } 451 }
452 } 452 }
453 ep->mii_phy_cnt = phy_idx; 453 ep->mii_phy_cnt = phy_idx;
454 if (phy_idx != 0) { 454 if (phy_idx != 0) {
455 phy = ep->phys[0]; 455 phy = ep->phys[0];
456 ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE); 456 ep->mii.advertising = mdio_read(dev, phy, MII_ADVERTISE);
457 printk(KERN_INFO DRV_NAME "(%s): Autonegotiation advertising %4.4x link " 457 dev_printk(KERN_INFO, &pdev->dev,
458 "Autonegotiation advertising %4.4x link "
458 "partner %4.4x.\n", 459 "partner %4.4x.\n",
459 pci_name(pdev), ep->mii.advertising, mdio_read(dev, phy, 5)); 460 ep->mii.advertising, mdio_read(dev, phy, 5));
460 } else if ( ! (ep->chip_flags & NO_MII)) { 461 } else if ( ! (ep->chip_flags & NO_MII)) {
461 printk(KERN_WARNING DRV_NAME "(%s): ***WARNING***: No MII transceiver found!\n", 462 dev_printk(KERN_WARNING, &pdev->dev,
462 pci_name(pdev)); 463 "***WARNING***: No MII transceiver found!\n");
463 /* Use the known PHY address of the EPII. */ 464 /* Use the known PHY address of the EPII. */
464 ep->phys[0] = 3; 465 ep->phys[0] = 3;
465 } 466 }
@@ -474,8 +475,8 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
474 /* The lower four bits are the media type. */ 475 /* The lower four bits are the media type. */
475 if (duplex) { 476 if (duplex) {
476 ep->mii.force_media = ep->mii.full_duplex = 1; 477 ep->mii.force_media = ep->mii.full_duplex = 1;
477 printk(KERN_INFO DRV_NAME "(%s): Forced full duplex operation requested.\n", 478 dev_printk(KERN_INFO, &pdev->dev,
478 pci_name(pdev)); 479 "Forced full duplex operation requested.\n");
479 } 480 }
480 dev->if_port = ep->default_port = option; 481 dev->if_port = ep->default_port = option;
481 482
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index aaf136658765..d26140ad36e9 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -578,9 +578,9 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
578 578
579 if (mii_status != 0xffff && mii_status != 0x0000) { 579 if (mii_status != 0xffff && mii_status != 0x0000) {
580 np->phys[phy_idx++] = phy; 580 np->phys[phy_idx++] = phy;
581 printk(KERN_INFO 581 dev_printk(KERN_INFO, &pdev->dev,
582 "%s: MII PHY found at address %d, status " 582 "MII PHY found at address %d, status "
583 "0x%4.4x.\n", dev->name, phy, mii_status); 583 "0x%4.4x.\n", phy, mii_status);
584 /* get phy type */ 584 /* get phy type */
585 { 585 {
586 unsigned int data; 586 unsigned int data;
@@ -603,10 +603,10 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
603 } 603 }
604 604
605 np->mii_cnt = phy_idx; 605 np->mii_cnt = phy_idx;
606 if (phy_idx == 0) { 606 if (phy_idx == 0)
607 printk(KERN_WARNING "%s: MII PHY not found -- this device may " 607 dev_printk(KERN_WARNING, &pdev->dev,
608 "not operate correctly.\n", dev->name); 608 "MII PHY not found -- this device may "
609 } 609 "not operate correctly.\n");
610 } else { 610 } else {
611 np->phys[0] = 32; 611 np->phys[0] = 32;
612/* 89/6/23 add, (begin) */ 612/* 89/6/23 add, (begin) */
@@ -632,7 +632,8 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
632 np->mii.full_duplex = full_duplex[card_idx]; 632 np->mii.full_duplex = full_duplex[card_idx];
633 633
634 if (np->mii.full_duplex) { 634 if (np->mii.full_duplex) {
635 printk(KERN_INFO "%s: Media type forced to Full Duplex.\n", dev->name); 635 dev_printk(KERN_INFO, &pdev->dev,
636 "Media type forced to Full Duplex.\n");
636/* 89/6/13 add, (begin) */ 637/* 89/6/13 add, (begin) */
637// if (np->PHYType==MarvellPHY) 638// if (np->PHYType==MarvellPHY)
638 if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) { 639 if ((np->PHYType == MarvellPHY) || (np->PHYType == LevelOnePHY)) {
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index 1b212a56933c..409c6aab0411 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -601,7 +601,8 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
601 pci_set_master(pdev); 601 pci_set_master(pdev);
602 602
603 i = pci_request_regions(pdev, DRV_NAME); 603 i = pci_request_regions(pdev, DRV_NAME);
604 if (i) return i; 604 if (i)
605 return i;
605 606
606 irq = pdev->irq; 607 irq = pdev->irq;
607 ioaddr = ioremap(base, 0x400); 608 ioaddr = ioremap(base, 0x400);
diff --git a/drivers/net/ne2k-pci.c b/drivers/net/ne2k-pci.c
index fa50eb889408..4f226064d55e 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,
231 irq = pdev->irq; 231 irq = pdev->irq;
232 232
233 if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) { 233 if (!ioaddr || ((pci_resource_flags (pdev, 0) & IORESOURCE_IO) == 0)) {
234 printk (KERN_ERR PFX "no I/O resource at PCI BAR #0\n"); 234 dev_printk (KERN_ERR, &pdev->dev,
235 "no I/O resource at PCI BAR #0\n");
235 return -ENODEV; 236 return -ENODEV;
236 } 237 }
237 238
238 if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) { 239 if (request_region (ioaddr, NE_IO_EXTENT, DRV_NAME) == NULL) {
239 printk (KERN_ERR PFX "I/O resource 0x%x @ 0x%lx busy\n", 240 dev_printk (KERN_ERR, &pdev->dev,
241 "I/O resource 0x%x @ 0x%lx busy\n",
240 NE_IO_EXTENT, ioaddr); 242 NE_IO_EXTENT, ioaddr);
241 return -EBUSY; 243 return -EBUSY;
242 } 244 }
@@ -263,7 +265,8 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
263 /* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */ 265 /* Allocate net_device, dev->priv; fill in 8390 specific dev fields. */
264 dev = alloc_ei_netdev(); 266 dev = alloc_ei_netdev();
265 if (!dev) { 267 if (!dev) {
266 printk (KERN_ERR PFX "cannot allocate ethernet device\n"); 268 dev_printk (KERN_ERR, &pdev->dev,
269 "cannot allocate ethernet device\n");
267 goto err_out_free_res; 270 goto err_out_free_res;
268 } 271 }
269 SET_MODULE_OWNER(dev); 272 SET_MODULE_OWNER(dev);
@@ -281,7 +284,8 @@ static int __devinit ne2k_pci_init_one (struct pci_dev *pdev,
281 while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0) 284 while ((inb(ioaddr + EN0_ISR) & ENISR_RESET) == 0)
282 /* Limit wait: '2' avoids jiffy roll-over. */ 285 /* Limit wait: '2' avoids jiffy roll-over. */
283 if (jiffies - reset_start_time > 2) { 286 if (jiffies - reset_start_time > 2) {
284 printk(KERN_ERR PFX "Card failure (no reset ack).\n"); 287 dev_printk(KERN_ERR, &pdev->dev,
288 "Card failure (no reset ack).\n");
285 goto err_out_free_netdev; 289 goto err_out_free_netdev;
286 } 290 }
287 291
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c
index 70429108c40d..d6e7ac2d0c94 100644
--- a/drivers/net/ns83820.c
+++ b/drivers/net/ns83820.c
@@ -1832,7 +1832,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1832 } else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) { 1832 } else if (!pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
1833 using_dac = 0; 1833 using_dac = 0;
1834 } else { 1834 } else {
1835 printk(KERN_WARNING "ns83820.c: pci_set_dma_mask failed!\n"); 1835 dev_printk(KERN_WARNING, &pci_dev->dev,
1836 "pci_set_dma_mask failed!\n");
1836 return -ENODEV; 1837 return -ENODEV;
1837 } 1838 }
1838 1839
@@ -1855,7 +1856,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1855 1856
1856 err = pci_enable_device(pci_dev); 1857 err = pci_enable_device(pci_dev);
1857 if (err) { 1858 if (err) {
1858 printk(KERN_INFO "ns83820: pci_enable_dev failed: %d\n", err); 1859 dev_printk(KERN_INFO, &pci_dev->dev,
1860 "pci_enable_dev failed: %d\n", err);
1859 goto out_free; 1861 goto out_free;
1860 } 1862 }
1861 1863
@@ -1884,8 +1886,9 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1884 err = request_irq(pci_dev->irq, ns83820_irq, IRQF_SHARED, 1886 err = request_irq(pci_dev->irq, ns83820_irq, IRQF_SHARED,
1885 DRV_NAME, ndev); 1887 DRV_NAME, ndev);
1886 if (err) { 1888 if (err) {
1887 printk(KERN_INFO "ns83820: unable to register irq %d\n", 1889 dev_printk(KERN_INFO, &pci_dev->dev,
1888 pci_dev->irq); 1890 "unable to register irq %d, err %d\n",
1891 pci_dev->irq, err);
1889 goto out_disable; 1892 goto out_disable;
1890 } 1893 }
1891 1894
@@ -1899,7 +1902,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
1899 rtnl_lock(); 1902 rtnl_lock();
1900 err = dev_alloc_name(ndev, ndev->name); 1903 err = dev_alloc_name(ndev, ndev->name);
1901 if (err < 0) { 1904 if (err < 0) {
1902 printk(KERN_INFO "ns83820: unable to get netdev name: %d\n", err); 1905 dev_printk(KERN_INFO, &pci_dev->dev,
1906 "unable to get netdev name: %d\n", err);
1903 goto out_free_irq; 1907 goto out_free_irq;
1904 } 1908 }
1905 1909
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index 3388ee1313ea..9c1ce318b077 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -601,7 +601,8 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
601 /* dev zeroed in alloc_etherdev */ 601 /* dev zeroed in alloc_etherdev */
602 dev = alloc_etherdev (sizeof (*tp)); 602 dev = alloc_etherdev (sizeof (*tp));
603 if (dev == NULL) { 603 if (dev == NULL) {
604 printk (KERN_ERR PFX "unable to alloc new ethernet\n"); 604 dev_printk (KERN_ERR, &pdev->dev,
605 "unable to alloc new ethernet\n");
605 DPRINTK ("EXIT, returning -ENOMEM\n"); 606 DPRINTK ("EXIT, returning -ENOMEM\n");
606 return -ENOMEM; 607 return -ENOMEM;
607 } 608 }
@@ -631,14 +632,16 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
631 632
632 /* make sure PCI base addr 0 is PIO */ 633 /* make sure PCI base addr 0 is PIO */
633 if (!(pio_flags & IORESOURCE_IO)) { 634 if (!(pio_flags & IORESOURCE_IO)) {
634 printk (KERN_ERR PFX "region #0 not a PIO resource, aborting\n"); 635 dev_printk (KERN_ERR, &pdev->dev,
636 "region #0 not a PIO resource, aborting\n");
635 rc = -ENODEV; 637 rc = -ENODEV;
636 goto err_out; 638 goto err_out;
637 } 639 }
638 640
639 /* make sure PCI base addr 1 is MMIO */ 641 /* make sure PCI base addr 1 is MMIO */
640 if (!(mmio_flags & IORESOURCE_MEM)) { 642 if (!(mmio_flags & IORESOURCE_MEM)) {
641 printk (KERN_ERR PFX "region #1 not an MMIO resource, aborting\n"); 643 dev_printk (KERN_ERR, &pdev->dev,
644 "region #1 not an MMIO resource, aborting\n");
642 rc = -ENODEV; 645 rc = -ENODEV;
643 goto err_out; 646 goto err_out;
644 } 647 }
@@ -646,12 +649,13 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
646 /* check for weird/broken PCI region reporting */ 649 /* check for weird/broken PCI region reporting */
647 if ((pio_len < NETDRV_MIN_IO_SIZE) || 650 if ((pio_len < NETDRV_MIN_IO_SIZE) ||
648 (mmio_len < NETDRV_MIN_IO_SIZE)) { 651 (mmio_len < NETDRV_MIN_IO_SIZE)) {
649 printk (KERN_ERR PFX "Invalid PCI region size(s), aborting\n"); 652 dev_printk (KERN_ERR, &pdev->dev,
653 "Invalid PCI region size(s), aborting\n");
650 rc = -ENODEV; 654 rc = -ENODEV;
651 goto err_out; 655 goto err_out;
652 } 656 }
653 657
654 rc = pci_request_regions (pdev, "pci-skeleton"); 658 rc = pci_request_regions (pdev, MODNAME);
655 if (rc) 659 if (rc)
656 goto err_out; 660 goto err_out;
657 661
@@ -663,7 +667,8 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
663 /* ioremap MMIO region */ 667 /* ioremap MMIO region */
664 ioaddr = ioremap (mmio_start, mmio_len); 668 ioaddr = ioremap (mmio_start, mmio_len);
665 if (ioaddr == NULL) { 669 if (ioaddr == NULL) {
666 printk (KERN_ERR PFX "cannot remap MMIO, aborting\n"); 670 dev_printk (KERN_ERR, &pdev->dev,
671 "cannot remap MMIO, aborting\n");
667 rc = -EIO; 672 rc = -EIO;
668 goto err_out_free_res; 673 goto err_out_free_res;
669 } 674 }
@@ -699,9 +704,10 @@ static int __devinit netdrv_init_board (struct pci_dev *pdev,
699 } 704 }
700 705
701 /* if unknown chip, assume array element #0, original RTL-8139 in this case */ 706 /* if unknown chip, assume array element #0, original RTL-8139 in this case */
702 printk (KERN_DEBUG PFX "PCI device %s: unknown chip version, assuming RTL-8139\n", 707 dev_printk (KERN_DEBUG, &pdev->dev,
703 pci_name(pdev)); 708 "unknown chip version, assuming RTL-8139\n");
704 printk (KERN_DEBUG PFX "PCI device %s: TxConfig = 0x%lx\n", pci_name(pdev), NETDRV_R32 (TxConfig)); 709 dev_printk (KERN_DEBUG, &pdev->dev, "TxConfig = 0x%lx\n",
710 NETDRV_R32 (TxConfig));
705 tp->chipset = 0; 711 tp->chipset = 0;
706 712
707match: 713match:
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,
1406 dev = alloc_etherdev(sizeof (*tp)); 1406 dev = alloc_etherdev(sizeof (*tp));
1407 if (dev == NULL) { 1407 if (dev == NULL) {
1408 if (netif_msg_drv(&debug)) 1408 if (netif_msg_drv(&debug))
1409 printk(KERN_ERR PFX "unable to alloc new ethernet\n"); 1409 dev_printk(KERN_ERR, &pdev->dev,
1410 "unable to alloc new ethernet\n");
1410 goto err_out; 1411 goto err_out;
1411 } 1412 }
1412 1413
@@ -1418,10 +1419,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1418 /* enable device (incl. PCI PM wakeup and hotplug setup) */ 1419 /* enable device (incl. PCI PM wakeup and hotplug setup) */
1419 rc = pci_enable_device(pdev); 1420 rc = pci_enable_device(pdev);
1420 if (rc < 0) { 1421 if (rc < 0) {
1421 if (netif_msg_probe(tp)) { 1422 if (netif_msg_probe(tp))
1422 printk(KERN_ERR PFX "%s: enable failure\n", 1423 dev_printk(KERN_ERR, &pdev->dev, "enable failure\n");
1423 pci_name(pdev));
1424 }
1425 goto err_out_free_dev; 1424 goto err_out_free_dev;
1426 } 1425 }
1427 1426
@@ -1437,37 +1436,33 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1437 pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command); 1436 pci_read_config_word(pdev, pm_cap + PCI_PM_CTRL, &pwr_command);
1438 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK; 1437 acpi_idle_state = pwr_command & PCI_PM_CTRL_STATE_MASK;
1439 } else { 1438 } else {
1440 if (netif_msg_probe(tp)) { 1439 if (netif_msg_probe(tp))
1441 printk(KERN_ERR PFX 1440 dev_printk(KERN_ERR, &pdev->dev,
1442 "PowerManagement capability not found.\n"); 1441 "PowerManagement capability not found.\n");
1443 }
1444 } 1442 }
1445 1443
1446 /* make sure PCI base addr 1 is MMIO */ 1444 /* make sure PCI base addr 1 is MMIO */
1447 if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) { 1445 if (!(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
1448 if (netif_msg_probe(tp)) { 1446 if (netif_msg_probe(tp))
1449 printk(KERN_ERR PFX 1447 dev_printk(KERN_ERR, &pdev->dev,
1450 "region #1 not an MMIO resource, aborting\n"); 1448 "region #1 not an MMIO resource, aborting\n");
1451 }
1452 rc = -ENODEV; 1449 rc = -ENODEV;
1453 goto err_out_mwi; 1450 goto err_out_mwi;
1454 } 1451 }
1455 /* check for weird/broken PCI region reporting */ 1452 /* check for weird/broken PCI region reporting */
1456 if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) { 1453 if (pci_resource_len(pdev, 1) < R8169_REGS_SIZE) {
1457 if (netif_msg_probe(tp)) { 1454 if (netif_msg_probe(tp))
1458 printk(KERN_ERR PFX 1455 dev_printk(KERN_ERR, &pdev->dev,
1459 "Invalid PCI region size(s), aborting\n"); 1456 "Invalid PCI region size(s), aborting\n");
1460 }
1461 rc = -ENODEV; 1457 rc = -ENODEV;
1462 goto err_out_mwi; 1458 goto err_out_mwi;
1463 } 1459 }
1464 1460
1465 rc = pci_request_regions(pdev, MODULENAME); 1461 rc = pci_request_regions(pdev, MODULENAME);
1466 if (rc < 0) { 1462 if (rc < 0) {
1467 if (netif_msg_probe(tp)) { 1463 if (netif_msg_probe(tp))
1468 printk(KERN_ERR PFX "%s: could not request regions.\n", 1464 dev_printk(KERN_ERR, &pdev->dev,
1469 pci_name(pdev)); 1465 "could not request regions.\n");
1470 }
1471 goto err_out_mwi; 1466 goto err_out_mwi;
1472 } 1467 }
1473 1468
@@ -1480,10 +1475,9 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1480 } else { 1475 } else {
1481 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); 1476 rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
1482 if (rc < 0) { 1477 if (rc < 0) {
1483 if (netif_msg_probe(tp)) { 1478 if (netif_msg_probe(tp))
1484 printk(KERN_ERR PFX 1479 dev_printk(KERN_ERR, &pdev->dev,
1485 "DMA configuration failed.\n"); 1480 "DMA configuration failed.\n");
1486 }
1487 goto err_out_free_res; 1481 goto err_out_free_res;
1488 } 1482 }
1489 } 1483 }
@@ -1494,7 +1488,8 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1494 ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE); 1488 ioaddr = ioremap(pci_resource_start(pdev, 1), R8169_REGS_SIZE);
1495 if (ioaddr == NULL) { 1489 if (ioaddr == NULL) {
1496 if (netif_msg_probe(tp)) 1490 if (netif_msg_probe(tp))
1497 printk(KERN_ERR PFX "cannot remap MMIO, aborting\n"); 1491 dev_printk(KERN_ERR, &pdev->dev,
1492 "cannot remap MMIO, aborting\n");
1498 rc = -EIO; 1493 rc = -EIO;
1499 goto err_out_free_res; 1494 goto err_out_free_res;
1500 } 1495 }
@@ -1526,9 +1521,9 @@ rtl8169_init_board(struct pci_dev *pdev, struct net_device **dev_out,
1526 if (i < 0) { 1521 if (i < 0) {
1527 /* Unknown chip: assume array element #0, original RTL-8169 */ 1522 /* Unknown chip: assume array element #0, original RTL-8169 */
1528 if (netif_msg_probe(tp)) { 1523 if (netif_msg_probe(tp)) {
1529 printk(KERN_DEBUG PFX "PCI device %s: " 1524 dev_printk(KERN_DEBUG, &pdev->dev,
1530 "unknown chip version, assuming %s\n", 1525 "unknown chip version, assuming %s\n",
1531 pci_name(pdev), rtl_chip_info[0].name); 1526 rtl_chip_info[0].name);
1532 } 1527 }
1533 i++; 1528 i++;
1534 } 1529 }