aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/skge.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-02-17 10:01:57 -0500
committerDavid S. Miller <davem@davemloft.net>2010-02-17 20:45:28 -0500
commitf15063cdd6bd541b4f35cec7e9a6c96f3c644c8d (patch)
treebff4ccb9a2088aeffa044f575c0f42c739382950 /drivers/net/skge.c
parent9cd31f078ee8b8dd68bbb39680b5c9a51f85f1ea (diff)
drivers/net/skge.c: Use (pr|netdev)_<level> macro helpers
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Remove #define PFX Use pr_<level> Use netdev_<level> Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/skge.c')
-rw-r--r--drivers/net/skge.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index ffa55df4d607..8aa24c52f319 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -23,6 +23,8 @@
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */ 24 */
25 25
26#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27
26#include <linux/in.h> 28#include <linux/in.h>
27#include <linux/kernel.h> 29#include <linux/kernel.h>
28#include <linux/module.h> 30#include <linux/module.h>
@@ -46,7 +48,6 @@
46 48
47#define DRV_NAME "skge" 49#define DRV_NAME "skge"
48#define DRV_VERSION "1.13" 50#define DRV_VERSION "1.13"
49#define PFX DRV_NAME " "
50 51
51#define DEFAULT_TX_RING_SIZE 128 52#define DEFAULT_TX_RING_SIZE 128
52#define DEFAULT_RX_RING_SIZE 512 53#define DEFAULT_RX_RING_SIZE 512
@@ -1129,8 +1130,7 @@ static u16 xm_phy_read(struct skge_hw *hw, int port, u16 reg)
1129{ 1130{
1130 u16 v = 0; 1131 u16 v = 0;
1131 if (__xm_phy_read(hw, port, reg, &v)) 1132 if (__xm_phy_read(hw, port, reg, &v))
1132 printk(KERN_WARNING PFX "%s: phy read timed out\n", 1133 pr_warning("%s: phy read timed out\n", hw->dev[port]->name);
1133 hw->dev[port]->name);
1134 return v; 1134 return v;
1135} 1135}
1136 1136
@@ -1252,8 +1252,7 @@ static void bcom_check_link(struct skge_hw *hw, int port)
1252 1252
1253 lpa = xm_phy_read(hw, port, PHY_XMAC_AUNE_LP); 1253 lpa = xm_phy_read(hw, port, PHY_XMAC_AUNE_LP);
1254 if (lpa & PHY_B_AN_RF) { 1254 if (lpa & PHY_B_AN_RF) {
1255 printk(KERN_NOTICE PFX "%s: remote fault\n", 1255 netdev_notice(dev, "remote fault\n");
1256 dev->name);
1257 return; 1256 return;
1258 } 1257 }
1259 1258
@@ -1268,8 +1267,7 @@ static void bcom_check_link(struct skge_hw *hw, int port)
1268 skge->duplex = DUPLEX_HALF; 1267 skge->duplex = DUPLEX_HALF;
1269 break; 1268 break;
1270 default: 1269 default:
1271 printk(KERN_NOTICE PFX "%s: duplex mismatch\n", 1270 netdev_notice(dev, "duplex mismatch\n");
1272 dev->name);
1273 return; 1271 return;
1274 } 1272 }
1275 1273
@@ -1461,8 +1459,7 @@ static int xm_check_link(struct net_device *dev)
1461 1459
1462 lpa = xm_phy_read(hw, port, PHY_XMAC_AUNE_LP); 1460 lpa = xm_phy_read(hw, port, PHY_XMAC_AUNE_LP);
1463 if (lpa & PHY_B_AN_RF) { 1461 if (lpa & PHY_B_AN_RF) {
1464 printk(KERN_NOTICE PFX "%s: remote fault\n", 1462 netdev_notice(dev, "remote fault\n");
1465 dev->name);
1466 return 0; 1463 return 0;
1467 } 1464 }
1468 1465
@@ -1477,8 +1474,7 @@ static int xm_check_link(struct net_device *dev)
1477 skge->duplex = DUPLEX_HALF; 1474 skge->duplex = DUPLEX_HALF;
1478 break; 1475 break;
1479 default: 1476 default:
1480 printk(KERN_NOTICE PFX "%s: duplex mismatch\n", 1477 netdev_notice(dev, "duplex mismatch\n");
1481 dev->name);
1482 return 0; 1478 return 0;
1483 } 1479 }
1484 1480
@@ -1566,7 +1562,7 @@ static void genesis_mac_init(struct skge_hw *hw, int port)
1566 udelay(1); 1562 udelay(1);
1567 } 1563 }
1568 1564
1569 printk(KERN_WARNING PFX "%s: genesis reset failed\n", dev->name); 1565 netdev_warn(dev, "genesis reset failed\n");
1570 1566
1571 reset_ok: 1567 reset_ok:
1572 /* Unreset the XMAC. */ 1568 /* Unreset the XMAC. */
@@ -1898,7 +1894,7 @@ static inline void bcom_phy_intr(struct skge_port *skge)
1898 "phy interrupt status 0x%x\n", isrc); 1894 "phy interrupt status 0x%x\n", isrc);
1899 1895
1900 if (isrc & PHY_B_IS_PSE) 1896 if (isrc & PHY_B_IS_PSE)
1901 printk(KERN_ERR PFX "%s: uncorrectable pair swap error\n", 1897 pr_err("%s: uncorrectable pair swap error\n",
1902 hw->dev[port]->name); 1898 hw->dev[port]->name);
1903 1899
1904 /* Workaround BCom Errata: 1900 /* Workaround BCom Errata:
@@ -1931,8 +1927,7 @@ static int gm_phy_write(struct skge_hw *hw, int port, u16 reg, u16 val)
1931 return 0; 1927 return 0;
1932 } 1928 }
1933 1929
1934 printk(KERN_WARNING PFX "%s: phy write timeout\n", 1930 pr_warning("%s: phy write timeout\n", hw->dev[port]->name);
1935 hw->dev[port]->name);
1936 return -EIO; 1931 return -EIO;
1937} 1932}
1938 1933
@@ -1960,8 +1955,7 @@ static u16 gm_phy_read(struct skge_hw *hw, int port, u16 reg)
1960{ 1955{
1961 u16 v = 0; 1956 u16 v = 0;
1962 if (__gm_phy_read(hw, port, reg, &v)) 1957 if (__gm_phy_read(hw, port, reg, &v))
1963 printk(KERN_WARNING PFX "%s: phy read timeout\n", 1958 pr_warning("%s: phy read timeout\n", hw->dev[port]->name);
1964 hw->dev[port]->name);
1965 return v; 1959 return v;
1966} 1960}
1967 1961
@@ -2434,8 +2428,7 @@ static void yukon_phy_intr(struct skge_port *skge)
2434 } 2428 }
2435 return; 2429 return;
2436 failed: 2430 failed:
2437 printk(KERN_ERR PFX "%s: autonegotiation failed (%s)\n", 2431 pr_err("%s: autonegotiation failed (%s)\n", skge->netdev->name, reason);
2438 skge->netdev->name, reason);
2439 2432
2440 /* XXX restart autonegotiation? */ 2433 /* XXX restart autonegotiation? */
2441} 2434}
@@ -2824,7 +2817,7 @@ static netdev_tx_t skge_xmit_frame(struct sk_buff *skb,
2824 smp_wmb(); 2817 smp_wmb();
2825 2818
2826 if (skge_avail(&skge->tx_ring) <= TX_LOW_WATER) { 2819 if (skge_avail(&skge->tx_ring) <= TX_LOW_WATER) {
2827 pr_debug("%s: transmit queue full\n", dev->name); 2820 netdev_dbg(dev, "transmit queue full\n");
2828 netif_stop_queue(dev); 2821 netif_stop_queue(dev);
2829 } 2822 }
2830 2823
@@ -3724,7 +3717,7 @@ static int skge_device_event(struct notifier_block *unused,
3724 if (d) 3717 if (d)
3725 skge->debugfs = d; 3718 skge->debugfs = d;
3726 else { 3719 else {
3727 pr_info(PFX "%s: rename failed\n", dev->name); 3720 netdev_info(dev, "rename failed\n");
3728 debugfs_remove(skge->debugfs); 3721 debugfs_remove(skge->debugfs);
3729 } 3722 }
3730 } 3723 }
@@ -3742,8 +3735,7 @@ static int skge_device_event(struct notifier_block *unused,
3742 skge_debug, dev, 3735 skge_debug, dev,
3743 &skge_debug_fops); 3736 &skge_debug_fops);
3744 if (!d || IS_ERR(d)) 3737 if (!d || IS_ERR(d))
3745 pr_info(PFX "%s: debugfs create failed\n", 3738 netdev_info(dev, "debugfs create failed\n");
3746 dev->name);
3747 else 3739 else
3748 skge->debugfs = d; 3740 skge->debugfs = d;
3749 break; 3741 break;
@@ -3764,7 +3756,7 @@ static __init void skge_debug_init(void)
3764 3756
3765 ent = debugfs_create_dir("skge", NULL); 3757 ent = debugfs_create_dir("skge", NULL);
3766 if (!ent || IS_ERR(ent)) { 3758 if (!ent || IS_ERR(ent)) {
3767 pr_info(PFX "debugfs create directory failed\n"); 3759 pr_info("debugfs create directory failed\n");
3768 return; 3760 return;
3769 } 3761 }
3770 3762
@@ -3945,9 +3937,10 @@ static int __devinit skge_probe(struct pci_dev *pdev,
3945 if (err) 3937 if (err)
3946 goto err_out_iounmap; 3938 goto err_out_iounmap;
3947 3939
3948 printk(KERN_INFO PFX DRV_VERSION " addr 0x%llx irq %d chip %s rev %d\n", 3940 pr_info("%s addr 0x%llx irq %d chip %s rev %d\n",
3949 (unsigned long long)pci_resource_start(pdev, 0), pdev->irq, 3941 DRV_VERSION,
3950 skge_board_name(hw), hw->chip_rev); 3942 (unsigned long long)pci_resource_start(pdev, 0), pdev->irq,
3943 skge_board_name(hw), hw->chip_rev);
3951 3944
3952 dev = skge_devinit(hw, 0, using_dac); 3945 dev = skge_devinit(hw, 0, using_dac);
3953 if (!dev) 3946 if (!dev)
@@ -4104,8 +4097,7 @@ static int skge_resume(struct pci_dev *pdev)
4104 err = skge_up(dev); 4097 err = skge_up(dev);
4105 4098
4106 if (err) { 4099 if (err) {
4107 printk(KERN_ERR PFX "%s: could not up: %d\n", 4100 netdev_err(dev, "could not up: %d\n", err);
4108 dev->name, err);
4109 dev_close(dev); 4101 dev_close(dev);
4110 goto out; 4102 goto out;
4111 } 4103 }