diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-01-09 21:54:29 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-10 16:31:12 -0500 |
commit | c6dd5098f47268976f7d0af3dad29084fd8b6b98 (patch) | |
tree | 7478f9ddede53722339ec59594229bb04abd2093 | |
parent | 45b9f509b7f5d2d792b3c03b78ddc8ec543e921b (diff) |
netdev: bfin_mac: clean up printk messages
Use netdev_* and pr_* helper funcs for output rather than printk.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/bfin_mac.c | 65 |
1 files changed, 29 insertions, 36 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c index ce1e5e9d06f6..a572bcb92d98 100644 --- a/drivers/net/bfin_mac.c +++ b/drivers/net/bfin_mac.c | |||
@@ -8,6 +8,11 @@ | |||
8 | * Licensed under the GPL-2 or later. | 8 | * Licensed under the GPL-2 or later. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define DRV_VERSION "1.1" | ||
12 | #define DRV_DESC "Blackfin on-chip Ethernet MAC driver" | ||
13 | |||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
11 | #include <linux/init.h> | 16 | #include <linux/init.h> |
12 | #include <linux/module.h> | 17 | #include <linux/module.h> |
13 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
@@ -41,12 +46,7 @@ | |||
41 | 46 | ||
42 | #include "bfin_mac.h" | 47 | #include "bfin_mac.h" |
43 | 48 | ||
44 | #define DRV_NAME "bfin_mac" | 49 | MODULE_AUTHOR("Bryan Wu, Luke Yang"); |
45 | #define DRV_VERSION "1.1" | ||
46 | #define DRV_AUTHOR "Bryan Wu, Luke Yang" | ||
47 | #define DRV_DESC "Blackfin on-chip Ethernet MAC driver" | ||
48 | |||
49 | MODULE_AUTHOR(DRV_AUTHOR); | ||
50 | MODULE_LICENSE("GPL"); | 50 | MODULE_LICENSE("GPL"); |
51 | MODULE_DESCRIPTION(DRV_DESC); | 51 | MODULE_DESCRIPTION(DRV_DESC); |
52 | MODULE_ALIAS("platform:bfin_mac"); | 52 | MODULE_ALIAS("platform:bfin_mac"); |
@@ -189,8 +189,7 @@ static int desc_list_init(void) | |||
189 | /* allocate a new skb for next time receive */ | 189 | /* allocate a new skb for next time receive */ |
190 | new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN); | 190 | new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN); |
191 | if (!new_skb) { | 191 | if (!new_skb) { |
192 | printk(KERN_NOTICE DRV_NAME | 192 | pr_notice("init: low on mem - packet dropped\n"); |
193 | ": init: low on mem - packet dropped\n"); | ||
194 | goto init_error; | 193 | goto init_error; |
195 | } | 194 | } |
196 | skb_reserve(new_skb, NET_IP_ALIGN); | 195 | skb_reserve(new_skb, NET_IP_ALIGN); |
@@ -240,7 +239,7 @@ static int desc_list_init(void) | |||
240 | 239 | ||
241 | init_error: | 240 | init_error: |
242 | desc_list_free(); | 241 | desc_list_free(); |
243 | printk(KERN_ERR DRV_NAME ": kmalloc failed\n"); | 242 | pr_err("kmalloc failed\n"); |
244 | return -ENOMEM; | 243 | return -ENOMEM; |
245 | } | 244 | } |
246 | 245 | ||
@@ -259,8 +258,7 @@ static int bfin_mdio_poll(void) | |||
259 | while ((bfin_read_EMAC_STAADD()) & STABUSY) { | 258 | while ((bfin_read_EMAC_STAADD()) & STABUSY) { |
260 | udelay(1); | 259 | udelay(1); |
261 | if (timeout_cnt-- < 0) { | 260 | if (timeout_cnt-- < 0) { |
262 | printk(KERN_ERR DRV_NAME | 261 | pr_err("wait MDC/MDIO transaction to complete timeout\n"); |
263 | ": wait MDC/MDIO transaction to complete timeout\n"); | ||
264 | return -ETIMEDOUT; | 262 | return -ETIMEDOUT; |
265 | } | 263 | } |
266 | } | 264 | } |
@@ -350,9 +348,9 @@ static void bfin_mac_adjust_link(struct net_device *dev) | |||
350 | opmode &= ~RMII_10; | 348 | opmode &= ~RMII_10; |
351 | break; | 349 | break; |
352 | default: | 350 | default: |
353 | printk(KERN_WARNING | 351 | netdev_warn(dev, |
354 | "%s: Ack! Speed (%d) is not 10/100!\n", | 352 | "Ack! Speed (%d) is not 10/100!\n", |
355 | DRV_NAME, phydev->speed); | 353 | phydev->speed); |
356 | break; | 354 | break; |
357 | } | 355 | } |
358 | bfin_write_EMAC_OPMODE(opmode); | 356 | bfin_write_EMAC_OPMODE(opmode); |
@@ -417,14 +415,13 @@ static int mii_probe(struct net_device *dev, int phy_mode) | |||
417 | 415 | ||
418 | /* now we are supposed to have a proper phydev, to attach to... */ | 416 | /* now we are supposed to have a proper phydev, to attach to... */ |
419 | if (!phydev) { | 417 | if (!phydev) { |
420 | printk(KERN_INFO "%s: Don't found any phy device at all\n", | 418 | netdev_err(dev, "no phy device found\n"); |
421 | dev->name); | ||
422 | return -ENODEV; | 419 | return -ENODEV; |
423 | } | 420 | } |
424 | 421 | ||
425 | if (phy_mode != PHY_INTERFACE_MODE_RMII && | 422 | if (phy_mode != PHY_INTERFACE_MODE_RMII && |
426 | phy_mode != PHY_INTERFACE_MODE_MII) { | 423 | phy_mode != PHY_INTERFACE_MODE_MII) { |
427 | printk(KERN_INFO "%s: Invalid phy interface mode\n", dev->name); | 424 | netdev_err(dev, "invalid phy interface mode\n"); |
428 | return -EINVAL; | 425 | return -EINVAL; |
429 | } | 426 | } |
430 | 427 | ||
@@ -432,7 +429,7 @@ static int mii_probe(struct net_device *dev, int phy_mode) | |||
432 | 0, phy_mode); | 429 | 0, phy_mode); |
433 | 430 | ||
434 | if (IS_ERR(phydev)) { | 431 | if (IS_ERR(phydev)) { |
435 | printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); | 432 | netdev_err(dev, "could not attach PHY\n"); |
436 | return PTR_ERR(phydev); | 433 | return PTR_ERR(phydev); |
437 | } | 434 | } |
438 | 435 | ||
@@ -453,11 +450,10 @@ static int mii_probe(struct net_device *dev, int phy_mode) | |||
453 | lp->old_duplex = -1; | 450 | lp->old_duplex = -1; |
454 | lp->phydev = phydev; | 451 | lp->phydev = phydev; |
455 | 452 | ||
456 | printk(KERN_INFO "%s: attached PHY driver [%s] " | 453 | pr_info("attached PHY driver [%s] " |
457 | "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)" | 454 | "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)@sclk=%dMHz)\n", |
458 | "@sclk=%dMHz)\n", | 455 | phydev->drv->name, dev_name(&phydev->dev), phydev->irq, |
459 | DRV_NAME, phydev->drv->name, dev_name(&phydev->dev), phydev->irq, | 456 | MDC_CLK, mdc_div, sclk/1000000); |
460 | MDC_CLK, mdc_div, sclk/1000000); | ||
461 | 457 | ||
462 | return 0; | 458 | return 0; |
463 | } | 459 | } |
@@ -502,7 +498,7 @@ bfin_mac_ethtool_setsettings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
502 | static void bfin_mac_ethtool_getdrvinfo(struct net_device *dev, | 498 | static void bfin_mac_ethtool_getdrvinfo(struct net_device *dev, |
503 | struct ethtool_drvinfo *info) | 499 | struct ethtool_drvinfo *info) |
504 | { | 500 | { |
505 | strcpy(info->driver, DRV_NAME); | 501 | strcpy(info->driver, KBUILD_MODNAME); |
506 | strcpy(info->version, DRV_VERSION); | 502 | strcpy(info->version, DRV_VERSION); |
507 | strcpy(info->fw_version, "N/A"); | 503 | strcpy(info->fw_version, "N/A"); |
508 | strcpy(info->bus_info, dev_name(&dev->dev)); | 504 | strcpy(info->bus_info, dev_name(&dev->dev)); |
@@ -827,8 +823,7 @@ static void bfin_tx_hwtstamp(struct net_device *netdev, struct sk_buff *skb) | |||
827 | while ((!(bfin_read_EMAC_PTP_ISTAT() & TXTL)) && (--timeout_cnt)) | 823 | while ((!(bfin_read_EMAC_PTP_ISTAT() & TXTL)) && (--timeout_cnt)) |
828 | udelay(1); | 824 | udelay(1); |
829 | if (timeout_cnt == 0) | 825 | if (timeout_cnt == 0) |
830 | printk(KERN_ERR DRV_NAME | 826 | netdev_err(netdev, "timestamp the TX packet failed\n"); |
831 | ": fails to timestamp the TX packet\n"); | ||
832 | else { | 827 | else { |
833 | struct skb_shared_hwtstamps shhwtstamps; | 828 | struct skb_shared_hwtstamps shhwtstamps; |
834 | u64 ns; | 829 | u64 ns; |
@@ -1083,8 +1078,7 @@ static void bfin_mac_rx(struct net_device *dev) | |||
1083 | * we which case we simply drop the packet | 1078 | * we which case we simply drop the packet |
1084 | */ | 1079 | */ |
1085 | if (current_rx_ptr->status.status_word & RX_ERROR_MASK) { | 1080 | if (current_rx_ptr->status.status_word & RX_ERROR_MASK) { |
1086 | printk(KERN_NOTICE DRV_NAME | 1081 | netdev_notice(dev, "rx: receive error - packet dropped\n"); |
1087 | ": rx: receive error - packet dropped\n"); | ||
1088 | dev->stats.rx_dropped++; | 1082 | dev->stats.rx_dropped++; |
1089 | goto out; | 1083 | goto out; |
1090 | } | 1084 | } |
@@ -1094,8 +1088,7 @@ static void bfin_mac_rx(struct net_device *dev) | |||
1094 | 1088 | ||
1095 | new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN); | 1089 | new_skb = dev_alloc_skb(PKT_BUF_SZ + NET_IP_ALIGN); |
1096 | if (!new_skb) { | 1090 | if (!new_skb) { |
1097 | printk(KERN_NOTICE DRV_NAME | 1091 | netdev_notice(dev, "rx: low on mem - packet dropped\n"); |
1098 | ": rx: low on mem - packet dropped\n"); | ||
1099 | dev->stats.rx_dropped++; | 1092 | dev->stats.rx_dropped++; |
1100 | goto out; | 1093 | goto out; |
1101 | } | 1094 | } |
@@ -1213,7 +1206,7 @@ static int bfin_mac_enable(struct phy_device *phydev) | |||
1213 | int ret; | 1206 | int ret; |
1214 | u32 opmode; | 1207 | u32 opmode; |
1215 | 1208 | ||
1216 | pr_debug("%s: %s\n", DRV_NAME, __func__); | 1209 | pr_debug("%s\n", __func__); |
1217 | 1210 | ||
1218 | /* Set RX DMA */ | 1211 | /* Set RX DMA */ |
1219 | bfin_write_DMA1_NEXT_DESC_PTR(&(rx_list_head->desc_a)); | 1212 | bfin_write_DMA1_NEXT_DESC_PTR(&(rx_list_head->desc_a)); |
@@ -1323,7 +1316,7 @@ static void bfin_mac_set_multicast_list(struct net_device *dev) | |||
1323 | u32 sysctl; | 1316 | u32 sysctl; |
1324 | 1317 | ||
1325 | if (dev->flags & IFF_PROMISC) { | 1318 | if (dev->flags & IFF_PROMISC) { |
1326 | printk(KERN_INFO "%s: set to promisc mode\n", dev->name); | 1319 | netdev_info(dev, "set promisc mode\n"); |
1327 | sysctl = bfin_read_EMAC_OPMODE(); | 1320 | sysctl = bfin_read_EMAC_OPMODE(); |
1328 | sysctl |= PR; | 1321 | sysctl |= PR; |
1329 | bfin_write_EMAC_OPMODE(sysctl); | 1322 | bfin_write_EMAC_OPMODE(sysctl); |
@@ -1393,7 +1386,7 @@ static int bfin_mac_open(struct net_device *dev) | |||
1393 | * address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx | 1386 | * address using ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx |
1394 | */ | 1387 | */ |
1395 | if (!is_valid_ether_addr(dev->dev_addr)) { | 1388 | if (!is_valid_ether_addr(dev->dev_addr)) { |
1396 | printk(KERN_WARNING DRV_NAME ": no valid ethernet hw addr\n"); | 1389 | netdev_warn(dev, "no valid ethernet hw addr\n"); |
1397 | return -EINVAL; | 1390 | return -EINVAL; |
1398 | } | 1391 | } |
1399 | 1392 | ||
@@ -1558,7 +1551,7 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev) | |||
1558 | bfin_mac_hwtstamp_init(ndev); | 1551 | bfin_mac_hwtstamp_init(ndev); |
1559 | 1552 | ||
1560 | /* now, print out the card info, in a short format.. */ | 1553 | /* now, print out the card info, in a short format.. */ |
1561 | dev_info(&pdev->dev, "%s, Version %s\n", DRV_DESC, DRV_VERSION); | 1554 | netdev_info(ndev, "%s, Version %s\n", DRV_DESC, DRV_VERSION); |
1562 | 1555 | ||
1563 | return 0; | 1556 | return 0; |
1564 | 1557 | ||
@@ -1650,7 +1643,7 @@ static int __devinit bfin_mii_bus_probe(struct platform_device *pdev) | |||
1650 | * so set the GPIO pins to Ethernet mode | 1643 | * so set the GPIO pins to Ethernet mode |
1651 | */ | 1644 | */ |
1652 | pin_req = mii_bus_pd->mac_peripherals; | 1645 | pin_req = mii_bus_pd->mac_peripherals; |
1653 | rc = peripheral_request_list(pin_req, DRV_NAME); | 1646 | rc = peripheral_request_list(pin_req, KBUILD_MODNAME); |
1654 | if (rc) { | 1647 | if (rc) { |
1655 | dev_err(&pdev->dev, "Requesting peripherals failed!\n"); | 1648 | dev_err(&pdev->dev, "Requesting peripherals failed!\n"); |
1656 | return rc; | 1649 | return rc; |
@@ -1739,7 +1732,7 @@ static struct platform_driver bfin_mac_driver = { | |||
1739 | .resume = bfin_mac_resume, | 1732 | .resume = bfin_mac_resume, |
1740 | .suspend = bfin_mac_suspend, | 1733 | .suspend = bfin_mac_suspend, |
1741 | .driver = { | 1734 | .driver = { |
1742 | .name = DRV_NAME, | 1735 | .name = KBUILD_MODNAME, |
1743 | .owner = THIS_MODULE, | 1736 | .owner = THIS_MODULE, |
1744 | }, | 1737 | }, |
1745 | }; | 1738 | }; |