diff options
author | Varka Bhadram <varkab@cdac.in> | 2014-07-14 04:39:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-07-14 22:14:15 -0400 |
commit | f7afbaa557337d059603ef8c3519831c9e0d1591 (patch) | |
tree | 6f23ac0990b6c4481c7b6c09fdff079b94a8ee78 /drivers/net/ethernet/amd/amd8111e.c | |
parent | 711fec5d22e15f24b11b6c7f79cc39cb96f52b13 (diff) |
ethernet: amd: dynamic debug fixes
This patch convert printk() to netdev_dbg/info/err or dev_info/err/dbg
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amd/amd8111e.c')
-rw-r--r-- | drivers/net/ethernet/amd/amd8111e.c | 58 |
1 files changed, 26 insertions, 32 deletions
diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c index 433107c3cd2b..c322aa77ad1c 100644 --- a/drivers/net/ethernet/amd/amd8111e.c +++ b/drivers/net/ethernet/amd/amd8111e.c | |||
@@ -501,8 +501,7 @@ static int amd8111e_restart(struct net_device *dev) | |||
501 | 501 | ||
502 | /* Enable interrupt coalesce */ | 502 | /* Enable interrupt coalesce */ |
503 | if(lp->options & OPTION_INTR_COAL_ENABLE){ | 503 | if(lp->options & OPTION_INTR_COAL_ENABLE){ |
504 | printk(KERN_INFO "%s: Interrupt Coalescing Enabled.\n", | 504 | netdev_info(dev, "Interrupt Coalescing Enabled.\n"); |
505 | dev->name); | ||
506 | amd8111e_set_coalesce(dev,ENABLE_COAL); | 505 | amd8111e_set_coalesce(dev,ENABLE_COAL); |
507 | } | 506 | } |
508 | 507 | ||
@@ -860,16 +859,19 @@ static int amd8111e_link_change(struct net_device* dev) | |||
860 | else if(speed == PHY_SPEED_100) | 859 | else if(speed == PHY_SPEED_100) |
861 | lp->link_config.speed = SPEED_100; | 860 | lp->link_config.speed = SPEED_100; |
862 | 861 | ||
863 | printk(KERN_INFO "%s: Link is Up. Speed is %s Mbps %s Duplex\n", dev->name, | 862 | netdev_info(dev, "Link is Up. Speed is %s Mbps %s Duplex\n", |
864 | (lp->link_config.speed == SPEED_100) ? "100": "10", | 863 | (lp->link_config.speed == SPEED_100) ? |
865 | (lp->link_config.duplex == DUPLEX_FULL)? "Full": "Half"); | 864 | "100" : "10", |
865 | (lp->link_config.duplex == DUPLEX_FULL) ? | ||
866 | "Full" : "Half"); | ||
867 | |||
866 | netif_carrier_on(dev); | 868 | netif_carrier_on(dev); |
867 | } | 869 | } |
868 | else{ | 870 | else{ |
869 | lp->link_config.speed = SPEED_INVALID; | 871 | lp->link_config.speed = SPEED_INVALID; |
870 | lp->link_config.duplex = DUPLEX_INVALID; | 872 | lp->link_config.duplex = DUPLEX_INVALID; |
871 | lp->link_config.autoneg = AUTONEG_INVALID; | 873 | lp->link_config.autoneg = AUTONEG_INVALID; |
872 | printk(KERN_INFO "%s: Link is Down.\n",dev->name); | 874 | netdev_info(dev, "Link is Down.\n"); |
873 | netif_carrier_off(dev); | 875 | netif_carrier_off(dev); |
874 | } | 876 | } |
875 | 877 | ||
@@ -1168,7 +1170,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id) | |||
1168 | /* Schedule a polling routine */ | 1170 | /* Schedule a polling routine */ |
1169 | __napi_schedule(&lp->napi); | 1171 | __napi_schedule(&lp->napi); |
1170 | } else if (intren0 & RINTEN0) { | 1172 | } else if (intren0 & RINTEN0) { |
1171 | printk("************Driver bug! interrupt while in poll\n"); | 1173 | netdev_dbg(dev, "************Driver bug! interrupt while in poll\n"); |
1172 | /* Fix by disable receive interrupts */ | 1174 | /* Fix by disable receive interrupts */ |
1173 | writel(RINTEN0, mmio + INTEN0); | 1175 | writel(RINTEN0, mmio + INTEN0); |
1174 | } | 1176 | } |
@@ -1264,7 +1266,7 @@ static int amd8111e_open(struct net_device * dev ) | |||
1264 | /* Start ipg timer */ | 1266 | /* Start ipg timer */ |
1265 | if(lp->options & OPTION_DYN_IPG_ENABLE){ | 1267 | if(lp->options & OPTION_DYN_IPG_ENABLE){ |
1266 | add_timer(&lp->ipg_data.ipg_timer); | 1268 | add_timer(&lp->ipg_data.ipg_timer); |
1267 | printk(KERN_INFO "%s: Dynamic IPG Enabled.\n",dev->name); | 1269 | netdev_info(dev, "Dynamic IPG Enabled\n"); |
1268 | } | 1270 | } |
1269 | 1271 | ||
1270 | lp->opened = 1; | 1272 | lp->opened = 1; |
@@ -1623,8 +1625,8 @@ static void amd8111e_tx_timeout(struct net_device *dev) | |||
1623 | struct amd8111e_priv* lp = netdev_priv(dev); | 1625 | struct amd8111e_priv* lp = netdev_priv(dev); |
1624 | int err; | 1626 | int err; |
1625 | 1627 | ||
1626 | printk(KERN_ERR "%s: transmit timed out, resetting\n", | 1628 | netdev_err(dev, "transmit timed out, resetting\n"); |
1627 | dev->name); | 1629 | |
1628 | spin_lock_irq(&lp->lock); | 1630 | spin_lock_irq(&lp->lock); |
1629 | err = amd8111e_restart(dev); | 1631 | err = amd8111e_restart(dev); |
1630 | spin_unlock_irq(&lp->lock); | 1632 | spin_unlock_irq(&lp->lock); |
@@ -1807,22 +1809,19 @@ static int amd8111e_probe_one(struct pci_dev *pdev, | |||
1807 | 1809 | ||
1808 | err = pci_enable_device(pdev); | 1810 | err = pci_enable_device(pdev); |
1809 | if(err){ | 1811 | if(err){ |
1810 | printk(KERN_ERR "amd8111e: Cannot enable new PCI device, " | 1812 | dev_err(&pdev->dev, "Cannot enable new PCI device\n"); |
1811 | "exiting.\n"); | ||
1812 | return err; | 1813 | return err; |
1813 | } | 1814 | } |
1814 | 1815 | ||
1815 | if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)){ | 1816 | if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)){ |
1816 | printk(KERN_ERR "amd8111e: Cannot find PCI base address, " | 1817 | dev_err(&pdev->dev, "Cannot find PCI base address\n"); |
1817 | "exiting.\n"); | ||
1818 | err = -ENODEV; | 1818 | err = -ENODEV; |
1819 | goto err_disable_pdev; | 1819 | goto err_disable_pdev; |
1820 | } | 1820 | } |
1821 | 1821 | ||
1822 | err = pci_request_regions(pdev, MODULE_NAME); | 1822 | err = pci_request_regions(pdev, MODULE_NAME); |
1823 | if(err){ | 1823 | if(err){ |
1824 | printk(KERN_ERR "amd8111e: Cannot obtain PCI resources, " | 1824 | dev_err(&pdev->dev, "Cannot obtain PCI resources\n"); |
1825 | "exiting.\n"); | ||
1826 | goto err_disable_pdev; | 1825 | goto err_disable_pdev; |
1827 | } | 1826 | } |
1828 | 1827 | ||
@@ -1830,16 +1829,14 @@ static int amd8111e_probe_one(struct pci_dev *pdev, | |||
1830 | 1829 | ||
1831 | /* Find power-management capability. */ | 1830 | /* Find power-management capability. */ |
1832 | if (!pdev->pm_cap) { | 1831 | if (!pdev->pm_cap) { |
1833 | printk(KERN_ERR "amd8111e: No Power Management capability, " | 1832 | dev_err(&pdev->dev, "No Power Management capability\n"); |
1834 | "exiting.\n"); | ||
1835 | err = -ENODEV; | 1833 | err = -ENODEV; |
1836 | goto err_free_reg; | 1834 | goto err_free_reg; |
1837 | } | 1835 | } |
1838 | 1836 | ||
1839 | /* Initialize DMA */ | 1837 | /* Initialize DMA */ |
1840 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) < 0) { | 1838 | if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) < 0) { |
1841 | printk(KERN_ERR "amd8111e: DMA not supported," | 1839 | dev_err(&pdev->dev, "DMA not supported\n"); |
1842 | "exiting.\n"); | ||
1843 | err = -ENODEV; | 1840 | err = -ENODEV; |
1844 | goto err_free_reg; | 1841 | goto err_free_reg; |
1845 | } | 1842 | } |
@@ -1868,8 +1865,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev, | |||
1868 | 1865 | ||
1869 | lp->mmio = devm_ioremap(&pdev->dev, reg_addr, reg_len); | 1866 | lp->mmio = devm_ioremap(&pdev->dev, reg_addr, reg_len); |
1870 | if (!lp->mmio) { | 1867 | if (!lp->mmio) { |
1871 | printk(KERN_ERR "amd8111e: Cannot map device registers, " | 1868 | dev_err(&pdev->dev, "Cannot map device registers\n"); |
1872 | "exiting\n"); | ||
1873 | err = -ENOMEM; | 1869 | err = -ENOMEM; |
1874 | goto err_free_dev; | 1870 | goto err_free_dev; |
1875 | } | 1871 | } |
@@ -1911,8 +1907,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev, | |||
1911 | 1907 | ||
1912 | err = register_netdev(dev); | 1908 | err = register_netdev(dev); |
1913 | if (err) { | 1909 | if (err) { |
1914 | printk(KERN_ERR "amd8111e: Cannot register net device, " | 1910 | dev_err(&pdev->dev, "Cannot register net device\n"); |
1915 | "exiting.\n"); | ||
1916 | goto err_free_dev; | 1911 | goto err_free_dev; |
1917 | } | 1912 | } |
1918 | 1913 | ||
@@ -1932,16 +1927,15 @@ static int amd8111e_probe_one(struct pci_dev *pdev, | |||
1932 | /* display driver and device information */ | 1927 | /* display driver and device information */ |
1933 | 1928 | ||
1934 | chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28; | 1929 | chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28; |
1935 | printk(KERN_INFO "%s: AMD-8111e Driver Version: %s\n", | 1930 | dev_info(&pdev->dev, "AMD-8111e Driver Version: %s\n", MODULE_VERS); |
1936 | dev->name,MODULE_VERS); | 1931 | dev_info(&pdev->dev, "[ Rev %x ] PCI 10/100BaseT Ethernet %pM\n", |
1937 | printk(KERN_INFO "%s: [ Rev %x ] PCI 10/100BaseT Ethernet %pM\n", | 1932 | chip_version, dev->dev_addr); |
1938 | dev->name, chip_version, dev->dev_addr); | ||
1939 | if (lp->ext_phy_id) | 1933 | if (lp->ext_phy_id) |
1940 | printk(KERN_INFO "%s: Found MII PHY ID 0x%08x at address 0x%02x\n", | 1934 | dev_info(&pdev->dev, "Found MII PHY ID 0x%08x at address 0x%02x\n", |
1941 | dev->name, lp->ext_phy_id, lp->ext_phy_addr); | 1935 | lp->ext_phy_id, lp->ext_phy_addr); |
1942 | else | 1936 | else |
1943 | printk(KERN_INFO "%s: Couldn't detect MII PHY, assuming address 0x01\n", | 1937 | dev_info(&pdev->dev, "Couldn't detect MII PHY, assuming address 0x01\n"); |
1944 | dev->name); | 1938 | |
1945 | return 0; | 1939 | return 0; |
1946 | 1940 | ||
1947 | err_free_dev: | 1941 | err_free_dev: |