diff options
author | Florian Fainelli <florian@openwrt.org> | 2010-04-06 18:09:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-07 05:07:50 -0400 |
commit | 5368c726b6a52e6778e59f362dfcaa5ae5cb6cd3 (patch) | |
tree | e4cff8dd4f8f6bac406f69239617649d9261eeea /drivers/net/au1000_eth.c | |
parent | 7cd2e6e38cd4402e09a286368f7a349e267aeb58 (diff) |
au1000-eth: Use (dev|netdev|netif)_<level> macro helpers
Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/au1000_eth.c')
-rw-r--r-- | drivers/net/au1000_eth.c | 116 |
1 files changed, 48 insertions, 68 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 0c59d4c5bc0..5afca6cee0f 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -187,8 +187,7 @@ static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg) | |||
187 | while (*mii_control_reg & MAC_MII_BUSY) { | 187 | while (*mii_control_reg & MAC_MII_BUSY) { |
188 | mdelay(1); | 188 | mdelay(1); |
189 | if (--timedout == 0) { | 189 | if (--timedout == 0) { |
190 | printk(KERN_ERR "%s: read_MII busy timeout!!\n", | 190 | netdev_err(dev, "read_MII busy timeout!!\n"); |
191 | dev->name); | ||
192 | return -1; | 191 | return -1; |
193 | } | 192 | } |
194 | } | 193 | } |
@@ -202,8 +201,7 @@ static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg) | |||
202 | while (*mii_control_reg & MAC_MII_BUSY) { | 201 | while (*mii_control_reg & MAC_MII_BUSY) { |
203 | mdelay(1); | 202 | mdelay(1); |
204 | if (--timedout == 0) { | 203 | if (--timedout == 0) { |
205 | printk(KERN_ERR "%s: mdio_read busy timeout!!\n", | 204 | netdev_err(dev, "mdio_read busy timeout!!\n"); |
206 | dev->name); | ||
207 | return -1; | 205 | return -1; |
208 | } | 206 | } |
209 | } | 207 | } |
@@ -222,8 +220,7 @@ static void au1000_mdio_write(struct net_device *dev, int phy_addr, | |||
222 | while (*mii_control_reg & MAC_MII_BUSY) { | 220 | while (*mii_control_reg & MAC_MII_BUSY) { |
223 | mdelay(1); | 221 | mdelay(1); |
224 | if (--timedout == 0) { | 222 | if (--timedout == 0) { |
225 | printk(KERN_ERR "%s: mdio_write busy timeout!!\n", | 223 | netdev_err(dev, "mdio_write busy timeout!!\n"); |
226 | dev->name); | ||
227 | return; | 224 | return; |
228 | } | 225 | } |
229 | } | 226 | } |
@@ -270,8 +267,7 @@ static void au1000_hard_stop(struct net_device *dev) | |||
270 | { | 267 | { |
271 | struct au1000_private *aup = netdev_priv(dev); | 268 | struct au1000_private *aup = netdev_priv(dev); |
272 | 269 | ||
273 | if (au1000_debug > 4) | 270 | netif_dbg(aup, drv, dev, "hard stop\n"); |
274 | printk(KERN_INFO "%s: hard stop\n", dev->name); | ||
275 | 271 | ||
276 | aup->mac->control &= ~(MAC_RX_ENABLE | MAC_TX_ENABLE); | 272 | aup->mac->control &= ~(MAC_RX_ENABLE | MAC_TX_ENABLE); |
277 | au_sync_delay(10); | 273 | au_sync_delay(10); |
@@ -281,8 +277,7 @@ static void au1000_enable_rx_tx(struct net_device *dev) | |||
281 | { | 277 | { |
282 | struct au1000_private *aup = netdev_priv(dev); | 278 | struct au1000_private *aup = netdev_priv(dev); |
283 | 279 | ||
284 | if (au1000_debug > 4) | 280 | netif_dbg(aup, hw, dev, "enable_rx_tx\n"); |
285 | printk(KERN_INFO "%s: enable_rx_tx\n", dev->name); | ||
286 | 281 | ||
287 | aup->mac->control |= (MAC_RX_ENABLE | MAC_TX_ENABLE); | 282 | aup->mac->control |= (MAC_RX_ENABLE | MAC_TX_ENABLE); |
288 | au_sync_delay(10); | 283 | au_sync_delay(10); |
@@ -309,9 +304,8 @@ au1000_adjust_link(struct net_device *dev) | |||
309 | case SPEED_100: | 304 | case SPEED_100: |
310 | break; | 305 | break; |
311 | default: | 306 | default: |
312 | printk(KERN_WARNING | 307 | netdev_warn(dev, "Speed (%d) is not 10/100 ???\n", |
313 | "%s: Speed (%d) is not 10/100 ???\n", | 308 | phydev->speed); |
314 | dev->name, phydev->speed); | ||
315 | break; | 309 | break; |
316 | } | 310 | } |
317 | 311 | ||
@@ -359,11 +353,11 @@ au1000_adjust_link(struct net_device *dev) | |||
359 | 353 | ||
360 | if (status_change) { | 354 | if (status_change) { |
361 | if (phydev->link) | 355 | if (phydev->link) |
362 | printk(KERN_INFO "%s: link up (%d/%s)\n", | 356 | netdev_info(dev, "link up (%d/%s)\n", |
363 | dev->name, phydev->speed, | 357 | phydev->speed, |
364 | DUPLEX_FULL == phydev->duplex ? "Full" : "Half"); | 358 | DUPLEX_FULL == phydev->duplex ? "Full" : "Half"); |
365 | else | 359 | else |
366 | printk(KERN_INFO "%s: link down\n", dev->name); | 360 | netdev_info(dev, "link down\n"); |
367 | } | 361 | } |
368 | } | 362 | } |
369 | 363 | ||
@@ -378,8 +372,7 @@ static int au1000_mii_probe (struct net_device *dev) | |||
378 | if (aup->phy_addr) | 372 | if (aup->phy_addr) |
379 | phydev = aup->mii_bus->phy_map[aup->phy_addr]; | 373 | phydev = aup->mii_bus->phy_map[aup->phy_addr]; |
380 | else | 374 | else |
381 | printk (KERN_INFO DRV_NAME ":%s: using PHY-less setup\n", | 375 | netdev_info(dev, "using PHY-less setup\n"); |
382 | dev->name); | ||
383 | return 0; | 376 | return 0; |
384 | } else { | 377 | } else { |
385 | int phy_addr; | 378 | int phy_addr; |
@@ -396,7 +389,7 @@ static int au1000_mii_probe (struct net_device *dev) | |||
396 | /* try harder to find a PHY */ | 389 | /* try harder to find a PHY */ |
397 | if (!phydev && (aup->mac_id == 1)) { | 390 | if (!phydev && (aup->mac_id == 1)) { |
398 | /* no PHY found, maybe we have a dual PHY? */ | 391 | /* no PHY found, maybe we have a dual PHY? */ |
399 | printk (KERN_INFO DRV_NAME ": no PHY found on MAC1, " | 392 | dev_info(&dev->dev, ": no PHY found on MAC1, " |
400 | "let's see if it's attached to MAC0...\n"); | 393 | "let's see if it's attached to MAC0...\n"); |
401 | 394 | ||
402 | /* find the first (lowest address) non-attached PHY on | 395 | /* find the first (lowest address) non-attached PHY on |
@@ -422,7 +415,7 @@ static int au1000_mii_probe (struct net_device *dev) | |||
422 | } | 415 | } |
423 | 416 | ||
424 | if (!phydev) { | 417 | if (!phydev) { |
425 | printk (KERN_ERR DRV_NAME ":%s: no PHY found\n", dev->name); | 418 | netdev_err(dev, "no PHY found\n"); |
426 | return -1; | 419 | return -1; |
427 | } | 420 | } |
428 | 421 | ||
@@ -433,7 +426,7 @@ static int au1000_mii_probe (struct net_device *dev) | |||
433 | 0, PHY_INTERFACE_MODE_MII); | 426 | 0, PHY_INTERFACE_MODE_MII); |
434 | 427 | ||
435 | if (IS_ERR(phydev)) { | 428 | if (IS_ERR(phydev)) { |
436 | printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); | 429 | netdev_err(dev, "Could not attach to PHY\n"); |
437 | return PTR_ERR(phydev); | 430 | return PTR_ERR(phydev); |
438 | } | 431 | } |
439 | 432 | ||
@@ -454,8 +447,8 @@ static int au1000_mii_probe (struct net_device *dev) | |||
454 | aup->old_duplex = -1; | 447 | aup->old_duplex = -1; |
455 | aup->phy_dev = phydev; | 448 | aup->phy_dev = phydev; |
456 | 449 | ||
457 | printk(KERN_INFO "%s: attached PHY driver [%s] " | 450 | netdev_info(dev, "attached PHY driver [%s] " |
458 | "(mii_bus:phy_addr=%s, irq=%d)\n", dev->name, | 451 | "(mii_bus:phy_addr=%s, irq=%d)\n", |
459 | phydev->drv->name, dev_name(&phydev->dev), phydev->irq); | 452 | phydev->drv->name, dev_name(&phydev->dev), phydev->irq); |
460 | 453 | ||
461 | return 0; | 454 | return 0; |
@@ -517,9 +510,8 @@ static void au1000_reset_mac(struct net_device *dev) | |||
517 | struct au1000_private *const aup = netdev_priv(dev); | 510 | struct au1000_private *const aup = netdev_priv(dev); |
518 | unsigned long flags; | 511 | unsigned long flags; |
519 | 512 | ||
520 | if (au1000_debug > 4) | 513 | netif_dbg(aup, hw, dev, "reset mac, aup %x\n", |
521 | printk(KERN_INFO "%s: reset mac, aup %x\n", | 514 | (unsigned)aup); |
522 | dev->name, (unsigned)aup); | ||
523 | 515 | ||
524 | spin_lock_irqsave(&aup->lock, flags); | 516 | spin_lock_irqsave(&aup->lock, flags); |
525 | 517 | ||
@@ -625,8 +617,7 @@ static int au1000_init(struct net_device *dev) | |||
625 | int i; | 617 | int i; |
626 | u32 control; | 618 | u32 control; |
627 | 619 | ||
628 | if (au1000_debug > 4) | 620 | netif_dbg(aup, hw, dev, "au1000_init\n"); |
629 | printk("%s: au1000_init\n", dev->name); | ||
630 | 621 | ||
631 | /* bring the device out of reset */ | 622 | /* bring the device out of reset */ |
632 | au1000_enable_mac(dev, 1); | 623 | au1000_enable_mac(dev, 1); |
@@ -703,8 +694,7 @@ static int au1000_rx(struct net_device *dev) | |||
703 | db_dest_t *pDB; | 694 | db_dest_t *pDB; |
704 | u32 frmlen; | 695 | u32 frmlen; |
705 | 696 | ||
706 | if (au1000_debug > 5) | 697 | netif_dbg(aup, rx_status, dev, "au1000_rx head %d\n", aup->rx_head); |
707 | printk("%s: au1000_rx head %d\n", dev->name, aup->rx_head); | ||
708 | 698 | ||
709 | prxd = aup->rx_dma_ring[aup->rx_head]; | 699 | prxd = aup->rx_dma_ring[aup->rx_head]; |
710 | buff_stat = prxd->buff_stat; | 700 | buff_stat = prxd->buff_stat; |
@@ -719,9 +709,7 @@ static int au1000_rx(struct net_device *dev) | |||
719 | frmlen -= 4; /* Remove FCS */ | 709 | frmlen -= 4; /* Remove FCS */ |
720 | skb = dev_alloc_skb(frmlen + 2); | 710 | skb = dev_alloc_skb(frmlen + 2); |
721 | if (skb == NULL) { | 711 | if (skb == NULL) { |
722 | printk(KERN_ERR | 712 | netdev_err(dev, "Memory squeeze, dropping packet.\n"); |
723 | "%s: Memory squeeze, dropping packet.\n", | ||
724 | dev->name); | ||
725 | dev->stats.rx_dropped++; | 713 | dev->stats.rx_dropped++; |
726 | continue; | 714 | continue; |
727 | } | 715 | } |
@@ -833,20 +821,18 @@ static int au1000_open(struct net_device *dev) | |||
833 | int retval; | 821 | int retval; |
834 | struct au1000_private *aup = netdev_priv(dev); | 822 | struct au1000_private *aup = netdev_priv(dev); |
835 | 823 | ||
836 | if (au1000_debug > 4) | 824 | netif_dbg(aup, drv, dev, "open: dev=%p\n", dev); |
837 | printk("%s: open: dev=%p\n", dev->name, dev); | ||
838 | 825 | ||
839 | retval = request_irq(dev->irq, au1000_interrupt, 0, | 826 | retval = request_irq(dev->irq, au1000_interrupt, 0, |
840 | dev->name, dev); | 827 | dev->name, dev); |
841 | if (retval) { | 828 | if (retval) { |
842 | printk(KERN_ERR "%s: unable to get IRQ %d\n", | 829 | netdev_err(dev, "unable to get IRQ %d\n", dev->irq); |
843 | dev->name, dev->irq); | ||
844 | return retval; | 830 | return retval; |
845 | } | 831 | } |
846 | 832 | ||
847 | retval = au1000_init(dev); | 833 | retval = au1000_init(dev); |
848 | if (retval) { | 834 | if (retval) { |
849 | printk(KERN_ERR "%s: error in au1000_init\n", dev->name); | 835 | netdev_err(dev, "error in au1000_init\n"); |
850 | free_irq(dev->irq, dev); | 836 | free_irq(dev->irq, dev); |
851 | return retval; | 837 | return retval; |
852 | } | 838 | } |
@@ -859,8 +845,7 @@ static int au1000_open(struct net_device *dev) | |||
859 | 845 | ||
860 | netif_start_queue(dev); | 846 | netif_start_queue(dev); |
861 | 847 | ||
862 | if (au1000_debug > 4) | 848 | netif_dbg(aup, drv, dev, "open: Initialization done.\n"); |
863 | printk("%s: open: Initialization done.\n", dev->name); | ||
864 | 849 | ||
865 | return 0; | 850 | return 0; |
866 | } | 851 | } |
@@ -870,8 +855,7 @@ static int au1000_close(struct net_device *dev) | |||
870 | unsigned long flags; | 855 | unsigned long flags; |
871 | struct au1000_private *const aup = netdev_priv(dev); | 856 | struct au1000_private *const aup = netdev_priv(dev); |
872 | 857 | ||
873 | if (au1000_debug > 4) | 858 | netif_dbg(aup, drv, dev, "close: dev=%p\n", dev); |
874 | printk("%s: close: dev=%p\n", dev->name, dev); | ||
875 | 859 | ||
876 | if (aup->phy_dev) | 860 | if (aup->phy_dev) |
877 | phy_stop(aup->phy_dev); | 861 | phy_stop(aup->phy_dev); |
@@ -902,9 +886,8 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev) | |||
902 | db_dest_t *pDB; | 886 | db_dest_t *pDB; |
903 | int i; | 887 | int i; |
904 | 888 | ||
905 | if (au1000_debug > 5) | 889 | netif_dbg(aup, tx_queued, dev, "tx: aup %x len=%d, data=%p, head %d\n", |
906 | printk("%s: tx: aup %x len=%d, data=%p, head %d\n", | 890 | (unsigned)aup, skb->len, |
907 | dev->name, (unsigned)aup, skb->len, | ||
908 | skb->data, aup->tx_head); | 891 | skb->data, aup->tx_head); |
909 | 892 | ||
910 | ptxd = aup->tx_dma_ring[aup->tx_head]; | 893 | ptxd = aup->tx_dma_ring[aup->tx_head]; |
@@ -951,7 +934,7 @@ static netdev_tx_t au1000_tx(struct sk_buff *skb, struct net_device *dev) | |||
951 | */ | 934 | */ |
952 | static void au1000_tx_timeout(struct net_device *dev) | 935 | static void au1000_tx_timeout(struct net_device *dev) |
953 | { | 936 | { |
954 | printk(KERN_ERR "%s: au1000_tx_timeout: dev=%p\n", dev->name, dev); | 937 | netdev_err(dev, "au1000_tx_timeout: dev=%p\n", dev); |
955 | au1000_reset_mac(dev); | 938 | au1000_reset_mac(dev); |
956 | au1000_init(dev); | 939 | au1000_init(dev); |
957 | dev->trans_start = jiffies; | 940 | dev->trans_start = jiffies; |
@@ -962,8 +945,7 @@ static void au1000_multicast_list(struct net_device *dev) | |||
962 | { | 945 | { |
963 | struct au1000_private *aup = netdev_priv(dev); | 946 | struct au1000_private *aup = netdev_priv(dev); |
964 | 947 | ||
965 | if (au1000_debug > 4) | 948 | netif_dbg(aup, drv, dev, "au1000_multicast_list: flags=%x\n", dev->flags); |
966 | printk("%s: au1000_multicast_list: flags=%x\n", dev->name, dev->flags); | ||
967 | 949 | ||
968 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ | 950 | if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ |
969 | aup->mac->control |= MAC_PROMISCUOUS; | 951 | aup->mac->control |= MAC_PROMISCUOUS; |
@@ -971,7 +953,7 @@ static void au1000_multicast_list(struct net_device *dev) | |||
971 | netdev_mc_count(dev) > MULTICAST_FILTER_LIMIT) { | 953 | netdev_mc_count(dev) > MULTICAST_FILTER_LIMIT) { |
972 | aup->mac->control |= MAC_PASS_ALL_MULTI; | 954 | aup->mac->control |= MAC_PASS_ALL_MULTI; |
973 | aup->mac->control &= ~MAC_PROMISCUOUS; | 955 | aup->mac->control &= ~MAC_PROMISCUOUS; |
974 | printk(KERN_INFO "%s: Pass all multicast\n", dev->name); | 956 | netdev_info(dev, "Pass all multicast\n"); |
975 | } else { | 957 | } else { |
976 | struct netdev_hw_addr *ha; | 958 | struct netdev_hw_addr *ha; |
977 | u32 mc_filter[2]; /* Multicast hash filter */ | 959 | u32 mc_filter[2]; /* Multicast hash filter */ |
@@ -1025,40 +1007,40 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1025 | 1007 | ||
1026 | base = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 1008 | base = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
1027 | if (!base) { | 1009 | if (!base) { |
1028 | printk(KERN_ERR DRV_NAME ": failed to retrieve base register\n"); | 1010 | dev_err(&pdev->dev, "failed to retrieve base register\n"); |
1029 | err = -ENODEV; | 1011 | err = -ENODEV; |
1030 | goto out; | 1012 | goto out; |
1031 | } | 1013 | } |
1032 | 1014 | ||
1033 | macen = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 1015 | macen = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
1034 | if (!macen) { | 1016 | if (!macen) { |
1035 | printk(KERN_ERR DRV_NAME ": failed to retrieve MAC Enable register\n"); | 1017 | dev_err(&pdev->dev, "failed to retrieve MAC Enable register\n"); |
1036 | err = -ENODEV; | 1018 | err = -ENODEV; |
1037 | goto out; | 1019 | goto out; |
1038 | } | 1020 | } |
1039 | 1021 | ||
1040 | irq = platform_get_irq(pdev, 0); | 1022 | irq = platform_get_irq(pdev, 0); |
1041 | if (irq < 0) { | 1023 | if (irq < 0) { |
1042 | printk(KERN_ERR DRV_NAME ": failed to retrieve IRQ\n"); | 1024 | dev_err(&pdev->dev, "failed to retrieve IRQ\n"); |
1043 | err = -ENODEV; | 1025 | err = -ENODEV; |
1044 | goto out; | 1026 | goto out; |
1045 | } | 1027 | } |
1046 | 1028 | ||
1047 | if (!request_mem_region(base->start, resource_size(base), pdev->name)) { | 1029 | if (!request_mem_region(base->start, resource_size(base), pdev->name)) { |
1048 | printk(KERN_ERR DRV_NAME ": failed to request memory region for base registers\n"); | 1030 | dev_err(&pdev->dev, "failed to request memory region for base registers\n"); |
1049 | err = -ENXIO; | 1031 | err = -ENXIO; |
1050 | goto out; | 1032 | goto out; |
1051 | } | 1033 | } |
1052 | 1034 | ||
1053 | if (!request_mem_region(macen->start, resource_size(macen), pdev->name)) { | 1035 | if (!request_mem_region(macen->start, resource_size(macen), pdev->name)) { |
1054 | printk(KERN_ERR DRV_NAME ": failed to request memory region for MAC enable register\n"); | 1036 | dev_err(&pdev->dev, "failed to request memory region for MAC enable register\n"); |
1055 | err = -ENXIO; | 1037 | err = -ENXIO; |
1056 | goto err_request; | 1038 | goto err_request; |
1057 | } | 1039 | } |
1058 | 1040 | ||
1059 | dev = alloc_etherdev(sizeof(struct au1000_private)); | 1041 | dev = alloc_etherdev(sizeof(struct au1000_private)); |
1060 | if (!dev) { | 1042 | if (!dev) { |
1061 | printk(KERN_ERR "%s: alloc_etherdev failed\n", DRV_NAME); | 1043 | dev_err(&pdev->dev, "alloc_etherdev failed\n"); |
1062 | err = -ENOMEM; | 1044 | err = -ENOMEM; |
1063 | goto err_alloc; | 1045 | goto err_alloc; |
1064 | } | 1046 | } |
@@ -1076,7 +1058,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1076 | (NUM_TX_BUFFS + NUM_RX_BUFFS), | 1058 | (NUM_TX_BUFFS + NUM_RX_BUFFS), |
1077 | &aup->dma_addr, 0); | 1059 | &aup->dma_addr, 0); |
1078 | if (!aup->vaddr) { | 1060 | if (!aup->vaddr) { |
1079 | printk(KERN_ERR DRV_NAME ": failed to allocate data buffers\n"); | 1061 | dev_err(&pdev->dev, "failed to allocate data buffers\n"); |
1080 | err = -ENOMEM; | 1062 | err = -ENOMEM; |
1081 | goto err_vaddr; | 1063 | goto err_vaddr; |
1082 | } | 1064 | } |
@@ -1084,7 +1066,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1084 | /* aup->mac is the base address of the MAC's registers */ | 1066 | /* aup->mac is the base address of the MAC's registers */ |
1085 | aup->mac = (volatile mac_reg_t *)ioremap_nocache(base->start, resource_size(base)); | 1067 | aup->mac = (volatile mac_reg_t *)ioremap_nocache(base->start, resource_size(base)); |
1086 | if (!aup->mac) { | 1068 | if (!aup->mac) { |
1087 | printk(KERN_ERR DRV_NAME ": failed to ioremap MAC registers\n"); | 1069 | dev_err(&pdev->dev, "failed to ioremap MAC registers\n"); |
1088 | err = -ENXIO; | 1070 | err = -ENXIO; |
1089 | goto err_remap1; | 1071 | goto err_remap1; |
1090 | } | 1072 | } |
@@ -1092,7 +1074,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1092 | /* Setup some variables for quick register address access */ | 1074 | /* Setup some variables for quick register address access */ |
1093 | aup->enable = (volatile u32 *)ioremap_nocache(macen->start, resource_size(macen)); | 1075 | aup->enable = (volatile u32 *)ioremap_nocache(macen->start, resource_size(macen)); |
1094 | if (!aup->enable) { | 1076 | if (!aup->enable) { |
1095 | printk(KERN_ERR DRV_NAME ": failed to ioremap MAC enable register\n"); | 1077 | dev_err(&pdev->dev, "failed to ioremap MAC enable register\n"); |
1096 | err = -ENXIO; | 1078 | err = -ENXIO; |
1097 | goto err_remap2; | 1079 | goto err_remap2; |
1098 | } | 1080 | } |
@@ -1102,8 +1084,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1102 | if (prom_get_ethernet_addr(ethaddr) == 0) | 1084 | if (prom_get_ethernet_addr(ethaddr) == 0) |
1103 | memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr)); | 1085 | memcpy(au1000_mac_addr, ethaddr, sizeof(au1000_mac_addr)); |
1104 | else { | 1086 | else { |
1105 | printk(KERN_INFO "%s: No MAC address found\n", | 1087 | netdev_info(dev, "No MAC address found\n"); |
1106 | dev->name); | ||
1107 | /* Use the hard coded MAC addresses */ | 1088 | /* Use the hard coded MAC addresses */ |
1108 | } | 1089 | } |
1109 | 1090 | ||
@@ -1123,7 +1104,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1123 | 1104 | ||
1124 | pd = pdev->dev.platform_data; | 1105 | pd = pdev->dev.platform_data; |
1125 | if (!pd) { | 1106 | if (!pd) { |
1126 | printk(KERN_INFO DRV_NAME ": no platform_data passed, PHY search on MAC0\n"); | 1107 | dev_info(&pdev->dev, "no platform_data passed, PHY search on MAC0\n"); |
1127 | aup->phy1_search_mac0 = 1; | 1108 | aup->phy1_search_mac0 = 1; |
1128 | } else { | 1109 | } else { |
1129 | aup->phy_static_config = pd->phy_static_config; | 1110 | aup->phy_static_config = pd->phy_static_config; |
@@ -1135,7 +1116,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1135 | } | 1116 | } |
1136 | 1117 | ||
1137 | if (aup->phy_busid && aup->phy_busid > 0) { | 1118 | if (aup->phy_busid && aup->phy_busid > 0) { |
1138 | printk(KERN_ERR DRV_NAME ": MAC0-associated PHY attached 2nd MACs MII" | 1119 | dev_err(&pdev->dev, "MAC0-associated PHY attached 2nd MACs MII" |
1139 | "bus not supported yet\n"); | 1120 | "bus not supported yet\n"); |
1140 | err = -ENODEV; | 1121 | err = -ENODEV; |
1141 | goto err_mdiobus_alloc; | 1122 | goto err_mdiobus_alloc; |
@@ -1143,7 +1124,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1143 | 1124 | ||
1144 | aup->mii_bus = mdiobus_alloc(); | 1125 | aup->mii_bus = mdiobus_alloc(); |
1145 | if (aup->mii_bus == NULL) { | 1126 | if (aup->mii_bus == NULL) { |
1146 | printk(KERN_ERR DRV_NAME ": failed to allocate mdiobus structure\n"); | 1127 | dev_err(&pdev->dev, "failed to allocate mdiobus structure\n"); |
1147 | err = -ENOMEM; | 1128 | err = -ENOMEM; |
1148 | goto err_mdiobus_alloc; | 1129 | goto err_mdiobus_alloc; |
1149 | } | 1130 | } |
@@ -1167,7 +1148,7 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1167 | 1148 | ||
1168 | err = mdiobus_register(aup->mii_bus); | 1149 | err = mdiobus_register(aup->mii_bus); |
1169 | if (err) { | 1150 | if (err) { |
1170 | printk(KERN_ERR DRV_NAME " failed to register MDIO bus\n"); | 1151 | dev_err(&pdev->dev, "failed to register MDIO bus\n"); |
1171 | goto err_mdiobus_reg; | 1152 | goto err_mdiobus_reg; |
1172 | } | 1153 | } |
1173 | 1154 | ||
@@ -1218,13 +1199,12 @@ static int __devinit au1000_probe(struct platform_device *pdev) | |||
1218 | 1199 | ||
1219 | err = register_netdev(dev); | 1200 | err = register_netdev(dev); |
1220 | if (err) { | 1201 | if (err) { |
1221 | printk(KERN_ERR DRV_NAME "%s: Cannot register net device, aborting.\n", | 1202 | netdev_err(dev, "Cannot register net device, aborting.\n"); |
1222 | dev->name); | ||
1223 | goto err_out; | 1203 | goto err_out; |
1224 | } | 1204 | } |
1225 | 1205 | ||
1226 | printk("%s: Au1xx0 Ethernet found at 0x%lx, irq %d\n", | 1206 | netdev_info(dev, "Au1xx0 Ethernet found at 0x%lx, irq %d\n", |
1227 | dev->name, (unsigned long)base->start, irq); | 1207 | (unsigned long)base->start, irq); |
1228 | if (version_printed++ == 0) | 1208 | if (version_printed++ == 0) |
1229 | printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR); | 1209 | printk("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR); |
1230 | 1210 | ||