Commit f7afbaa5 authored by Varka Bhadram's avatar Varka Bhadram Committed by David S. Miller

ethernet: amd: dynamic debug fixes

This patch convert printk() to netdev_dbg/info/err or dev_info/err/dbg
Signed-off-by: default avatarVarka Bhadram <varkab@cdac.in>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 711fec5d
...@@ -501,8 +501,7 @@ static int amd8111e_restart(struct net_device *dev) ...@@ -501,8 +501,7 @@ static int amd8111e_restart(struct net_device *dev)
/* Enable interrupt coalesce */ /* Enable interrupt coalesce */
if(lp->options & OPTION_INTR_COAL_ENABLE){ if(lp->options & OPTION_INTR_COAL_ENABLE){
printk(KERN_INFO "%s: Interrupt Coalescing Enabled.\n", netdev_info(dev, "Interrupt Coalescing Enabled.\n");
dev->name);
amd8111e_set_coalesce(dev,ENABLE_COAL); amd8111e_set_coalesce(dev,ENABLE_COAL);
} }
...@@ -860,16 +859,19 @@ static int amd8111e_link_change(struct net_device* dev) ...@@ -860,16 +859,19 @@ static int amd8111e_link_change(struct net_device* dev)
else if(speed == PHY_SPEED_100) else if(speed == PHY_SPEED_100)
lp->link_config.speed = SPEED_100; lp->link_config.speed = SPEED_100;
printk(KERN_INFO "%s: Link is Up. Speed is %s Mbps %s Duplex\n", dev->name, netdev_info(dev, "Link is Up. Speed is %s Mbps %s Duplex\n",
(lp->link_config.speed == SPEED_100) ? "100": "10", (lp->link_config.speed == SPEED_100) ?
(lp->link_config.duplex == DUPLEX_FULL)? "Full": "Half"); "100" : "10",
(lp->link_config.duplex == DUPLEX_FULL) ?
"Full" : "Half");
netif_carrier_on(dev); netif_carrier_on(dev);
} }
else{ else{
lp->link_config.speed = SPEED_INVALID; lp->link_config.speed = SPEED_INVALID;
lp->link_config.duplex = DUPLEX_INVALID; lp->link_config.duplex = DUPLEX_INVALID;
lp->link_config.autoneg = AUTONEG_INVALID; lp->link_config.autoneg = AUTONEG_INVALID;
printk(KERN_INFO "%s: Link is Down.\n",dev->name); netdev_info(dev, "Link is Down.\n");
netif_carrier_off(dev); netif_carrier_off(dev);
} }
...@@ -1168,7 +1170,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id) ...@@ -1168,7 +1170,7 @@ static irqreturn_t amd8111e_interrupt(int irq, void *dev_id)
/* Schedule a polling routine */ /* Schedule a polling routine */
__napi_schedule(&lp->napi); __napi_schedule(&lp->napi);
} else if (intren0 & RINTEN0) { } else if (intren0 & RINTEN0) {
printk("************Driver bug! interrupt while in poll\n"); netdev_dbg(dev, "************Driver bug! interrupt while in poll\n");
/* Fix by disable receive interrupts */ /* Fix by disable receive interrupts */
writel(RINTEN0, mmio + INTEN0); writel(RINTEN0, mmio + INTEN0);
} }
...@@ -1264,7 +1266,7 @@ static int amd8111e_open(struct net_device * dev ) ...@@ -1264,7 +1266,7 @@ static int amd8111e_open(struct net_device * dev )
/* Start ipg timer */ /* Start ipg timer */
if(lp->options & OPTION_DYN_IPG_ENABLE){ if(lp->options & OPTION_DYN_IPG_ENABLE){
add_timer(&lp->ipg_data.ipg_timer); add_timer(&lp->ipg_data.ipg_timer);
printk(KERN_INFO "%s: Dynamic IPG Enabled.\n",dev->name); netdev_info(dev, "Dynamic IPG Enabled\n");
} }
lp->opened = 1; lp->opened = 1;
...@@ -1623,8 +1625,8 @@ static void amd8111e_tx_timeout(struct net_device *dev) ...@@ -1623,8 +1625,8 @@ static void amd8111e_tx_timeout(struct net_device *dev)
struct amd8111e_priv* lp = netdev_priv(dev); struct amd8111e_priv* lp = netdev_priv(dev);
int err; int err;
printk(KERN_ERR "%s: transmit timed out, resetting\n", netdev_err(dev, "transmit timed out, resetting\n");
dev->name);
spin_lock_irq(&lp->lock); spin_lock_irq(&lp->lock);
err = amd8111e_restart(dev); err = amd8111e_restart(dev);
spin_unlock_irq(&lp->lock); spin_unlock_irq(&lp->lock);
...@@ -1807,22 +1809,19 @@ static int amd8111e_probe_one(struct pci_dev *pdev, ...@@ -1807,22 +1809,19 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if(err){ if(err){
printk(KERN_ERR "amd8111e: Cannot enable new PCI device, " dev_err(&pdev->dev, "Cannot enable new PCI device\n");
"exiting.\n");
return err; return err;
} }
if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)){ if(!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)){
printk(KERN_ERR "amd8111e: Cannot find PCI base address, " dev_err(&pdev->dev, "Cannot find PCI base address\n");
"exiting.\n");
err = -ENODEV; err = -ENODEV;
goto err_disable_pdev; goto err_disable_pdev;
} }
err = pci_request_regions(pdev, MODULE_NAME); err = pci_request_regions(pdev, MODULE_NAME);
if(err){ if(err){
printk(KERN_ERR "amd8111e: Cannot obtain PCI resources, " dev_err(&pdev->dev, "Cannot obtain PCI resources\n");
"exiting.\n");
goto err_disable_pdev; goto err_disable_pdev;
} }
...@@ -1830,16 +1829,14 @@ static int amd8111e_probe_one(struct pci_dev *pdev, ...@@ -1830,16 +1829,14 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
/* Find power-management capability. */ /* Find power-management capability. */
if (!pdev->pm_cap) { if (!pdev->pm_cap) {
printk(KERN_ERR "amd8111e: No Power Management capability, " dev_err(&pdev->dev, "No Power Management capability\n");
"exiting.\n");
err = -ENODEV; err = -ENODEV;
goto err_free_reg; goto err_free_reg;
} }
/* Initialize DMA */ /* Initialize DMA */
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) < 0) { if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) < 0) {
printk(KERN_ERR "amd8111e: DMA not supported," dev_err(&pdev->dev, "DMA not supported\n");
"exiting.\n");
err = -ENODEV; err = -ENODEV;
goto err_free_reg; goto err_free_reg;
} }
...@@ -1868,8 +1865,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev, ...@@ -1868,8 +1865,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
lp->mmio = devm_ioremap(&pdev->dev, reg_addr, reg_len); lp->mmio = devm_ioremap(&pdev->dev, reg_addr, reg_len);
if (!lp->mmio) { if (!lp->mmio) {
printk(KERN_ERR "amd8111e: Cannot map device registers, " dev_err(&pdev->dev, "Cannot map device registers\n");
"exiting\n");
err = -ENOMEM; err = -ENOMEM;
goto err_free_dev; goto err_free_dev;
} }
...@@ -1911,8 +1907,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev, ...@@ -1911,8 +1907,7 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
err = register_netdev(dev); err = register_netdev(dev);
if (err) { if (err) {
printk(KERN_ERR "amd8111e: Cannot register net device, " dev_err(&pdev->dev, "Cannot register net device\n");
"exiting.\n");
goto err_free_dev; goto err_free_dev;
} }
...@@ -1932,16 +1927,15 @@ static int amd8111e_probe_one(struct pci_dev *pdev, ...@@ -1932,16 +1927,15 @@ static int amd8111e_probe_one(struct pci_dev *pdev,
/* display driver and device information */ /* display driver and device information */
chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28; chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28;
printk(KERN_INFO "%s: AMD-8111e Driver Version: %s\n", dev_info(&pdev->dev, "AMD-8111e Driver Version: %s\n", MODULE_VERS);
dev->name,MODULE_VERS); dev_info(&pdev->dev, "[ Rev %x ] PCI 10/100BaseT Ethernet %pM\n",
printk(KERN_INFO "%s: [ Rev %x ] PCI 10/100BaseT Ethernet %pM\n", chip_version, dev->dev_addr);
dev->name, chip_version, dev->dev_addr);
if (lp->ext_phy_id) if (lp->ext_phy_id)
printk(KERN_INFO "%s: Found MII PHY ID 0x%08x at address 0x%02x\n", dev_info(&pdev->dev, "Found MII PHY ID 0x%08x at address 0x%02x\n",
dev->name, lp->ext_phy_id, lp->ext_phy_addr); lp->ext_phy_id, lp->ext_phy_addr);
else else
printk(KERN_INFO "%s: Couldn't detect MII PHY, assuming address 0x01\n", dev_info(&pdev->dev, "Couldn't detect MII PHY, assuming address 0x01\n");
dev->name);
return 0; return 0;
err_free_dev: err_free_dev:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment