diff options
Diffstat (limited to 'drivers/net/8139cp.c')
-rw-r--r-- | drivers/net/8139cp.c | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 1959654cbec8..1428bb7715af 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1836,9 +1836,10 @@ 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_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_err(&pdev->dev, "Try the \"8139too\" driver instead.\n"); | ||
1842 | return -ENODEV; | 1843 | return -ENODEV; |
1843 | } | 1844 | } |
1844 | 1845 | ||
@@ -1876,14 +1877,13 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1876 | pciaddr = pci_resource_start(pdev, 1); | 1877 | pciaddr = pci_resource_start(pdev, 1); |
1877 | if (!pciaddr) { | 1878 | if (!pciaddr) { |
1878 | rc = -EIO; | 1879 | rc = -EIO; |
1879 | printk(KERN_ERR PFX "no MMIO resource for pci dev %s\n", | 1880 | dev_err(&pdev->dev, "no MMIO resource\n"); |
1880 | pci_name(pdev)); | ||
1881 | goto err_out_res; | 1881 | goto err_out_res; |
1882 | } | 1882 | } |
1883 | if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) { | 1883 | if (pci_resource_len(pdev, 1) < CP_REGS_SIZE) { |
1884 | rc = -EIO; | 1884 | rc = -EIO; |
1885 | printk(KERN_ERR PFX "MMIO resource (%llx) too small on pci dev %s\n", | 1885 | dev_err(&pdev->dev, "MMIO resource (%llx) too small\n", |
1886 | (unsigned long long)pci_resource_len(pdev, 1), pci_name(pdev)); | 1886 | (unsigned long long)pci_resource_len(pdev, 1)); |
1887 | goto err_out_res; | 1887 | goto err_out_res; |
1888 | } | 1888 | } |
1889 | 1889 | ||
@@ -1897,14 +1897,15 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1897 | 1897 | ||
1898 | rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); | 1898 | rc = pci_set_dma_mask(pdev, DMA_32BIT_MASK); |
1899 | if (rc) { | 1899 | if (rc) { |
1900 | printk(KERN_ERR PFX "No usable DMA configuration, " | 1900 | dev_err(&pdev->dev, |
1901 | "aborting.\n"); | 1901 | "No usable DMA configuration, aborting.\n"); |
1902 | goto err_out_res; | 1902 | goto err_out_res; |
1903 | } | 1903 | } |
1904 | rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); | 1904 | rc = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK); |
1905 | if (rc) { | 1905 | if (rc) { |
1906 | printk(KERN_ERR PFX "No usable consistent DMA configuration, " | 1906 | dev_err(&pdev->dev, |
1907 | "aborting.\n"); | 1907 | "No usable consistent DMA configuration, " |
1908 | "aborting.\n"); | ||
1908 | goto err_out_res; | 1909 | goto err_out_res; |
1909 | } | 1910 | } |
1910 | } | 1911 | } |
@@ -1915,9 +1916,9 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1915 | regs = ioremap(pciaddr, CP_REGS_SIZE); | 1916 | regs = ioremap(pciaddr, CP_REGS_SIZE); |
1916 | if (!regs) { | 1917 | if (!regs) { |
1917 | rc = -EIO; | 1918 | rc = -EIO; |
1918 | printk(KERN_ERR PFX "Cannot map PCI MMIO (%llx@%llx) on pci dev %s\n", | 1919 | dev_err(&pdev->dev, "Cannot map PCI MMIO (%Lx@%Lx)\n", |
1919 | (unsigned long long)pci_resource_len(pdev, 1), | 1920 | (unsigned long long)pci_resource_len(pdev, 1), |
1920 | (unsigned long long)pciaddr, pci_name(pdev)); | 1921 | (unsigned long long)pciaddr); |
1921 | goto err_out_res; | 1922 | goto err_out_res; |
1922 | } | 1923 | } |
1923 | dev->base_addr = (unsigned long) regs; | 1924 | dev->base_addr = (unsigned long) regs; |
@@ -1986,7 +1987,8 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1986 | /* enable busmastering and memory-write-invalidate */ | 1987 | /* enable busmastering and memory-write-invalidate */ |
1987 | pci_set_master(pdev); | 1988 | pci_set_master(pdev); |
1988 | 1989 | ||
1989 | if (cp->wol_enabled) cp_set_d3_state (cp); | 1990 | if (cp->wol_enabled) |
1991 | cp_set_d3_state (cp); | ||
1990 | 1992 | ||
1991 | return 0; | 1993 | return 0; |
1992 | 1994 | ||
@@ -2011,7 +2013,8 @@ static void cp_remove_one (struct pci_dev *pdev) | |||
2011 | BUG_ON(!dev); | 2013 | BUG_ON(!dev); |
2012 | unregister_netdev(dev); | 2014 | unregister_netdev(dev); |
2013 | iounmap(cp->regs); | 2015 | iounmap(cp->regs); |
2014 | if (cp->wol_enabled) pci_set_power_state (pdev, PCI_D0); | 2016 | if (cp->wol_enabled) |
2017 | pci_set_power_state (pdev, PCI_D0); | ||
2015 | pci_release_regions(pdev); | 2018 | pci_release_regions(pdev); |
2016 | pci_clear_mwi(pdev); | 2019 | pci_clear_mwi(pdev); |
2017 | pci_disable_device(pdev); | 2020 | pci_disable_device(pdev); |