aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/r6040.c
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2010-04-07 17:39:27 -0400
committerDavid S. Miller <davem@davemloft.net>2010-04-13 04:29:41 -0400
commit7d53b80980a598836c56517290b29aa7b0766ef8 (patch)
tree9c6f299c18a883b5a021b4173177473b3d96aea3 /drivers/net/r6040.c
parent82e381775f6da6b29ae625e73a2ea18844eb4825 (diff)
r6040: use (dev|netdev)_<level> macros helpers
Signed-off-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/r6040.c')
-rw-r--r--drivers/net/r6040.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 467fe3b955e0..412291645596 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -330,7 +330,7 @@ static int r6040_alloc_rxbufs(struct net_device *dev)
330 do { 330 do {
331 skb = netdev_alloc_skb(dev, MAX_BUF_SIZE); 331 skb = netdev_alloc_skb(dev, MAX_BUF_SIZE);
332 if (!skb) { 332 if (!skb) {
333 printk(KERN_ERR DRV_NAME "%s: failed to alloc skb for rx\n", dev->name); 333 netdev_err(dev, "failed to alloc skb for rx\n");
334 rc = -ENOMEM; 334 rc = -ENOMEM;
335 goto err_exit; 335 goto err_exit;
336 } 336 }
@@ -410,9 +410,9 @@ static void r6040_tx_timeout(struct net_device *dev)
410 struct r6040_private *priv = netdev_priv(dev); 410 struct r6040_private *priv = netdev_priv(dev);
411 void __iomem *ioaddr = priv->base; 411 void __iomem *ioaddr = priv->base;
412 412
413 printk(KERN_WARNING "%s: transmit timed out, int enable %4.4x " 413 netdev_warn(dev, "transmit timed out, int enable %4.4x "
414 "status %4.4x, PHY status %4.4x\n", 414 "status %4.4x, PHY status %4.4x\n",
415 dev->name, ioread16(ioaddr + MIER), 415 ioread16(ioaddr + MIER),
416 ioread16(ioaddr + MISR), 416 ioread16(ioaddr + MISR),
417 r6040_mdio_read(dev, priv->mii_if.phy_id, MII_BMSR)); 417 r6040_mdio_read(dev, priv->mii_if.phy_id, MII_BMSR));
418 418
@@ -897,7 +897,7 @@ static netdev_tx_t r6040_start_xmit(struct sk_buff *skb,
897 if (!lp->tx_free_desc) { 897 if (!lp->tx_free_desc) {
898 spin_unlock_irqrestore(&lp->lock, flags); 898 spin_unlock_irqrestore(&lp->lock, flags);
899 netif_stop_queue(dev); 899 netif_stop_queue(dev);
900 printk(KERN_ERR DRV_NAME ": no tx descriptor\n"); 900 netdev_err(dev, ": no tx descriptor\n");
901 return NETDEV_TX_BUSY; 901 return NETDEV_TX_BUSY;
902 } 902 }
903 903
@@ -1090,20 +1090,20 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1090 /* this should always be supported */ 1090 /* this should always be supported */
1091 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32)); 1091 err = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
1092 if (err) { 1092 if (err) {
1093 printk(KERN_ERR DRV_NAME ": 32-bit PCI DMA addresses" 1093 dev_err(&pdev->dev, "32-bit PCI DMA addresses"
1094 "not supported by the card\n"); 1094 "not supported by the card\n");
1095 goto err_out; 1095 goto err_out;
1096 } 1096 }
1097 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)); 1097 err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
1098 if (err) { 1098 if (err) {
1099 printk(KERN_ERR DRV_NAME ": 32-bit PCI DMA addresses" 1099 dev_err(&pdev->dev, "32-bit PCI DMA addresses"
1100 "not supported by the card\n"); 1100 "not supported by the card\n");
1101 goto err_out; 1101 goto err_out;
1102 } 1102 }
1103 1103
1104 /* IO Size check */ 1104 /* IO Size check */
1105 if (pci_resource_len(pdev, bar) < io_size) { 1105 if (pci_resource_len(pdev, bar) < io_size) {
1106 printk(KERN_ERR DRV_NAME ": Insufficient PCI resources, aborting\n"); 1106 dev_err(&pdev->dev, "Insufficient PCI resources, aborting\n");
1107 err = -EIO; 1107 err = -EIO;
1108 goto err_out; 1108 goto err_out;
1109 } 1109 }
@@ -1112,7 +1112,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1112 1112
1113 dev = alloc_etherdev(sizeof(struct r6040_private)); 1113 dev = alloc_etherdev(sizeof(struct r6040_private));
1114 if (!dev) { 1114 if (!dev) {
1115 printk(KERN_ERR DRV_NAME ": Failed to allocate etherdev\n"); 1115 dev_err(&pdev->dev, "Failed to allocate etherdev\n");
1116 err = -ENOMEM; 1116 err = -ENOMEM;
1117 goto err_out; 1117 goto err_out;
1118 } 1118 }
@@ -1122,14 +1122,13 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1122 err = pci_request_regions(pdev, DRV_NAME); 1122 err = pci_request_regions(pdev, DRV_NAME);
1123 1123
1124 if (err) { 1124 if (err) {
1125 printk(KERN_ERR DRV_NAME ": Failed to request PCI regions\n"); 1125 dev_err(&pdev->dev, "Failed to request PCI regions\n");
1126 goto err_out_free_dev; 1126 goto err_out_free_dev;
1127 } 1127 }
1128 1128
1129 ioaddr = pci_iomap(pdev, bar, io_size); 1129 ioaddr = pci_iomap(pdev, bar, io_size);
1130 if (!ioaddr) { 1130 if (!ioaddr) {
1131 printk(KERN_ERR DRV_NAME ": ioremap failed for device %s\n", 1131 dev_err(&pdev->dev, "ioremap failed for device\n");
1132 pci_name(pdev));
1133 err = -EIO; 1132 err = -EIO;
1134 goto err_out_free_res; 1133 goto err_out_free_res;
1135 } 1134 }
@@ -1156,7 +1155,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1156 /* Some bootloader/BIOSes do not initialize 1155 /* Some bootloader/BIOSes do not initialize
1157 * MAC address, warn about that */ 1156 * MAC address, warn about that */
1158 if (!(adrp[0] || adrp[1] || adrp[2])) { 1157 if (!(adrp[0] || adrp[1] || adrp[2])) {
1159 printk(KERN_WARNING DRV_NAME ": MAC address not initialized, generating random\n"); 1158 netdev_warn(dev, "MAC address not initialized, generating random\n");
1160 random_ether_addr(dev->dev_addr); 1159 random_ether_addr(dev->dev_addr);
1161 } 1160 }
1162 1161
@@ -1184,7 +1183,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1184 1183
1185 /* Check the vendor ID on the PHY, if 0xffff assume none attached */ 1184 /* Check the vendor ID on the PHY, if 0xffff assume none attached */
1186 if (r6040_phy_read(ioaddr, lp->phy_addr, 2) == 0xffff) { 1185 if (r6040_phy_read(ioaddr, lp->phy_addr, 2) == 0xffff) {
1187 printk(KERN_ERR DRV_NAME ": Failed to detect an attached PHY\n"); 1186 dev_err(&pdev->dev, "Failed to detect an attached PHY\n");
1188 err = -ENODEV; 1187 err = -ENODEV;
1189 goto err_out_unmap; 1188 goto err_out_unmap;
1190 } 1189 }
@@ -1192,7 +1191,7 @@ static int __devinit r6040_init_one(struct pci_dev *pdev,
1192 /* Register net device. After this dev->name assign */ 1191 /* Register net device. After this dev->name assign */
1193 err = register_netdev(dev); 1192 err = register_netdev(dev);
1194 if (err) { 1193 if (err) {
1195 printk(KERN_ERR DRV_NAME ": Failed to register net device\n"); 1194 dev_err(&pdev->dev, "Failed to register net device\n");
1196 goto err_out_unmap; 1195 goto err_out_unmap;
1197 } 1196 }
1198 return 0; 1197 return 0;