diff options
author | Joe Perches <joe@perches.com> | 2010-02-17 10:01:50 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-17 20:45:19 -0500 |
commit | 2fc96fff4483971aa81795382c368ea7d8100dde (patch) | |
tree | 47ffb60cdf4411c9d87ac1caeca6b50158c6ae8b /drivers/net/b44.c | |
parent | 497159aff6c81b61fe88463a64e7dad6f86297e3 (diff) |
drivers/net/b44.c: Use (pr|netdev|netif)_<level> macro helpers
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove #define PFX
Use pr_<level>
Use netdev_<level>
Use netif_<level>
Remove periods from formats
Coalesce long formats
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/b44.c')
-rw-r--r-- | drivers/net/b44.c | 72 |
1 files changed, 31 insertions, 41 deletions
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index f21cbe63c7b1..180510ed92a5 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -10,6 +10,8 @@ | |||
10 | * Distribute under GPL. | 10 | * Distribute under GPL. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
14 | |||
13 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
14 | #include <linux/module.h> | 16 | #include <linux/module.h> |
15 | #include <linux/moduleparam.h> | 17 | #include <linux/moduleparam.h> |
@@ -34,7 +36,6 @@ | |||
34 | #include "b44.h" | 36 | #include "b44.h" |
35 | 37 | ||
36 | #define DRV_MODULE_NAME "b44" | 38 | #define DRV_MODULE_NAME "b44" |
37 | #define PFX DRV_MODULE_NAME ": " | ||
38 | #define DRV_MODULE_VERSION "2.0" | 39 | #define DRV_MODULE_VERSION "2.0" |
39 | 40 | ||
40 | #define B44_DEF_MSG_ENABLE \ | 41 | #define B44_DEF_MSG_ENABLE \ |
@@ -190,12 +191,9 @@ static int b44_wait_bit(struct b44 *bp, unsigned long reg, | |||
190 | } | 191 | } |
191 | if (i == timeout) { | 192 | if (i == timeout) { |
192 | if (net_ratelimit()) | 193 | if (net_ratelimit()) |
193 | printk(KERN_ERR PFX "%s: BUG! Timeout waiting for bit " | 194 | netdev_err(bp->dev, "BUG! Timeout waiting for bit %08x of register %lx to %s\n", |
194 | "%08x of register " | 195 | bit, reg, clear ? "clear" : "set"); |
195 | "%lx to %s.\n", | 196 | |
196 | bp->dev->name, | ||
197 | bit, reg, | ||
198 | (clear ? "clear" : "set")); | ||
199 | return -ENODEV; | 197 | return -ENODEV; |
200 | } | 198 | } |
201 | return 0; | 199 | return 0; |
@@ -335,8 +333,7 @@ static int b44_phy_reset(struct b44 *bp) | |||
335 | err = b44_readphy(bp, MII_BMCR, &val); | 333 | err = b44_readphy(bp, MII_BMCR, &val); |
336 | if (!err) { | 334 | if (!err) { |
337 | if (val & BMCR_RESET) { | 335 | if (val & BMCR_RESET) { |
338 | printk(KERN_ERR PFX "%s: PHY Reset would not complete.\n", | 336 | netdev_err(bp->dev, "PHY Reset would not complete\n"); |
339 | bp->dev->name); | ||
340 | err = -ENODEV; | 337 | err = -ENODEV; |
341 | } | 338 | } |
342 | } | 339 | } |
@@ -415,7 +412,7 @@ static void b44_wap54g10_workaround(struct b44 *bp) | |||
415 | } | 412 | } |
416 | return; | 413 | return; |
417 | error: | 414 | error: |
418 | printk(KERN_WARNING PFX "PHY: cannot reset MII transceiver isolate bit.\n"); | 415 | pr_warning("PHY: cannot reset MII transceiver isolate bit\n"); |
419 | } | 416 | } |
420 | #else | 417 | #else |
421 | static inline void b44_wap54g10_workaround(struct b44 *bp) | 418 | static inline void b44_wap54g10_workaround(struct b44 *bp) |
@@ -508,18 +505,15 @@ static void b44_stats_update(struct b44 *bp) | |||
508 | static void b44_link_report(struct b44 *bp) | 505 | static void b44_link_report(struct b44 *bp) |
509 | { | 506 | { |
510 | if (!netif_carrier_ok(bp->dev)) { | 507 | if (!netif_carrier_ok(bp->dev)) { |
511 | printk(KERN_INFO PFX "%s: Link is down.\n", bp->dev->name); | 508 | netdev_info(bp->dev, "Link is down\n"); |
512 | } else { | 509 | } else { |
513 | printk(KERN_INFO PFX "%s: Link is up at %d Mbps, %s duplex.\n", | 510 | netdev_info(bp->dev, "Link is up at %d Mbps, %s duplex\n", |
514 | bp->dev->name, | 511 | (bp->flags & B44_FLAG_100_BASE_T) ? 100 : 10, |
515 | (bp->flags & B44_FLAG_100_BASE_T) ? 100 : 10, | 512 | (bp->flags & B44_FLAG_FULL_DUPLEX) ? "full" : "half"); |
516 | (bp->flags & B44_FLAG_FULL_DUPLEX) ? "full" : "half"); | 513 | |
517 | 514 | netdev_info(bp->dev, "Flow control is %s for TX and %s for RX\n", | |
518 | printk(KERN_INFO PFX "%s: Flow control is %s for TX and " | 515 | (bp->flags & B44_FLAG_TX_PAUSE) ? "on" : "off", |
519 | "%s for RX.\n", | 516 | (bp->flags & B44_FLAG_RX_PAUSE) ? "on" : "off"); |
520 | bp->dev->name, | ||
521 | (bp->flags & B44_FLAG_TX_PAUSE) ? "on" : "off", | ||
522 | (bp->flags & B44_FLAG_RX_PAUSE) ? "on" : "off"); | ||
523 | } | 517 | } |
524 | } | 518 | } |
525 | 519 | ||
@@ -578,11 +572,9 @@ static void b44_check_phy(struct b44 *bp) | |||
578 | } | 572 | } |
579 | 573 | ||
580 | if (bmsr & BMSR_RFAULT) | 574 | if (bmsr & BMSR_RFAULT) |
581 | printk(KERN_WARNING PFX "%s: Remote fault detected in PHY\n", | 575 | netdev_warn(bp->dev, "Remote fault detected in PHY\n"); |
582 | bp->dev->name); | ||
583 | if (bmsr & BMSR_JCD) | 576 | if (bmsr & BMSR_JCD) |
584 | printk(KERN_WARNING PFX "%s: Jabber detected in PHY\n", | 577 | netdev_warn(bp->dev, "Jabber detected in PHY\n"); |
585 | bp->dev->name); | ||
586 | } | 578 | } |
587 | } | 579 | } |
588 | 580 | ||
@@ -903,7 +895,7 @@ static irqreturn_t b44_interrupt(int irq, void *dev_id) | |||
903 | handled = 1; | 895 | handled = 1; |
904 | 896 | ||
905 | if (unlikely(!netif_running(dev))) { | 897 | if (unlikely(!netif_running(dev))) { |
906 | printk(KERN_INFO "%s: late interrupt.\n", dev->name); | 898 | netdev_info(dev, "late interrupt\n"); |
907 | goto irq_ack; | 899 | goto irq_ack; |
908 | } | 900 | } |
909 | 901 | ||
@@ -928,8 +920,7 @@ static void b44_tx_timeout(struct net_device *dev) | |||
928 | { | 920 | { |
929 | struct b44 *bp = netdev_priv(dev); | 921 | struct b44 *bp = netdev_priv(dev); |
930 | 922 | ||
931 | printk(KERN_ERR PFX "%s: transmit timed out, resetting\n", | 923 | netdev_err(dev, "transmit timed out, resetting\n"); |
932 | dev->name); | ||
933 | 924 | ||
934 | spin_lock_irq(&bp->lock); | 925 | spin_lock_irq(&bp->lock); |
935 | 926 | ||
@@ -958,8 +949,7 @@ static netdev_tx_t b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
958 | /* This is a hard error, log it. */ | 949 | /* This is a hard error, log it. */ |
959 | if (unlikely(TX_BUFFS_AVAIL(bp) < 1)) { | 950 | if (unlikely(TX_BUFFS_AVAIL(bp) < 1)) { |
960 | netif_stop_queue(dev); | 951 | netif_stop_queue(dev); |
961 | printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", | 952 | netdev_err(dev, "BUG! Tx Ring full when queue awake!\n"); |
962 | dev->name); | ||
963 | goto err_out; | 953 | goto err_out; |
964 | } | 954 | } |
965 | 955 | ||
@@ -1335,7 +1325,7 @@ static void b44_halt(struct b44 *bp) | |||
1335 | /* reset PHY */ | 1325 | /* reset PHY */ |
1336 | b44_phy_reset(bp); | 1326 | b44_phy_reset(bp); |
1337 | /* power down PHY */ | 1327 | /* power down PHY */ |
1338 | printk(KERN_INFO PFX "%s: powering down PHY\n", bp->dev->name); | 1328 | netdev_info(bp->dev, "powering down PHY\n"); |
1339 | bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN); | 1329 | bw32(bp, B44_MAC_CTRL, MAC_CTRL_PHY_PDOWN); |
1340 | /* now reset the chip, but without enabling the MAC&PHY | 1330 | /* now reset the chip, but without enabling the MAC&PHY |
1341 | * part of it. This has to be done _after_ we shut down the PHY */ | 1331 | * part of it. This has to be done _after_ we shut down the PHY */ |
@@ -1526,7 +1516,7 @@ static void b44_setup_pseudo_magicp(struct b44 *bp) | |||
1526 | 1516 | ||
1527 | pwol_pattern = kzalloc(B44_PATTERN_SIZE, GFP_KERNEL); | 1517 | pwol_pattern = kzalloc(B44_PATTERN_SIZE, GFP_KERNEL); |
1528 | if (!pwol_pattern) { | 1518 | if (!pwol_pattern) { |
1529 | printk(KERN_ERR PFX "Memory not available for WOL\n"); | 1519 | pr_err("Memory not available for WOL\n"); |
1530 | return; | 1520 | return; |
1531 | } | 1521 | } |
1532 | 1522 | ||
@@ -2099,7 +2089,7 @@ static int __devinit b44_get_invariants(struct b44 *bp) | |||
2099 | memcpy(bp->dev->dev_addr, addr, 6); | 2089 | memcpy(bp->dev->dev_addr, addr, 6); |
2100 | 2090 | ||
2101 | if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){ | 2091 | if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){ |
2102 | printk(KERN_ERR PFX "Invalid MAC address found in EEPROM\n"); | 2092 | pr_err("Invalid MAC address found in EEPROM\n"); |
2103 | return -EINVAL; | 2093 | return -EINVAL; |
2104 | } | 2094 | } |
2105 | 2095 | ||
@@ -2144,12 +2134,12 @@ static int __devinit b44_init_one(struct ssb_device *sdev, | |||
2144 | instance++; | 2134 | instance++; |
2145 | 2135 | ||
2146 | if (b44_version_printed++ == 0) | 2136 | if (b44_version_printed++ == 0) |
2147 | printk(KERN_INFO "%s", version); | 2137 | pr_info("%s", version); |
2148 | 2138 | ||
2149 | 2139 | ||
2150 | dev = alloc_etherdev(sizeof(*bp)); | 2140 | dev = alloc_etherdev(sizeof(*bp)); |
2151 | if (!dev) { | 2141 | if (!dev) { |
2152 | dev_err(sdev->dev, "Etherdev alloc failed, aborting.\n"); | 2142 | dev_err(sdev->dev, "Etherdev alloc failed, aborting\n"); |
2153 | err = -ENOMEM; | 2143 | err = -ENOMEM; |
2154 | goto out; | 2144 | goto out; |
2155 | } | 2145 | } |
@@ -2188,13 +2178,13 @@ static int __devinit b44_init_one(struct ssb_device *sdev, | |||
2188 | err = ssb_dma_set_mask(sdev, DMA_BIT_MASK(30)); | 2178 | err = ssb_dma_set_mask(sdev, DMA_BIT_MASK(30)); |
2189 | if (err) { | 2179 | if (err) { |
2190 | dev_err(sdev->dev, | 2180 | dev_err(sdev->dev, |
2191 | "Required 30BIT DMA mask unsupported by the system.\n"); | 2181 | "Required 30BIT DMA mask unsupported by the system\n"); |
2192 | goto err_out_powerdown; | 2182 | goto err_out_powerdown; |
2193 | } | 2183 | } |
2194 | err = b44_get_invariants(bp); | 2184 | err = b44_get_invariants(bp); |
2195 | if (err) { | 2185 | if (err) { |
2196 | dev_err(sdev->dev, | 2186 | dev_err(sdev->dev, |
2197 | "Problem fetching invariants of chip, aborting.\n"); | 2187 | "Problem fetching invariants of chip, aborting\n"); |
2198 | goto err_out_powerdown; | 2188 | goto err_out_powerdown; |
2199 | } | 2189 | } |
2200 | 2190 | ||
@@ -2214,7 +2204,7 @@ static int __devinit b44_init_one(struct ssb_device *sdev, | |||
2214 | 2204 | ||
2215 | err = register_netdev(dev); | 2205 | err = register_netdev(dev); |
2216 | if (err) { | 2206 | if (err) { |
2217 | dev_err(sdev->dev, "Cannot register net device, aborting.\n"); | 2207 | dev_err(sdev->dev, "Cannot register net device, aborting\n"); |
2218 | goto err_out_powerdown; | 2208 | goto err_out_powerdown; |
2219 | } | 2209 | } |
2220 | 2210 | ||
@@ -2225,8 +2215,8 @@ static int __devinit b44_init_one(struct ssb_device *sdev, | |||
2225 | */ | 2215 | */ |
2226 | b44_chip_reset(bp, B44_CHIP_RESET_FULL); | 2216 | b44_chip_reset(bp, B44_CHIP_RESET_FULL); |
2227 | 2217 | ||
2228 | printk(KERN_INFO "%s: Broadcom 44xx/47xx 10/100BaseT Ethernet %pM\n", | 2218 | netdev_info(dev, "Broadcom 44xx/47xx 10/100BaseT Ethernet %pM\n", |
2229 | dev->name, dev->dev_addr); | 2219 | dev->dev_addr); |
2230 | 2220 | ||
2231 | return 0; | 2221 | return 0; |
2232 | 2222 | ||
@@ -2299,7 +2289,7 @@ static int b44_resume(struct ssb_device *sdev) | |||
2299 | 2289 | ||
2300 | rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev); | 2290 | rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev); |
2301 | if (rc) { | 2291 | if (rc) { |
2302 | printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name); | 2292 | netdev_err(dev, "request_irq failed\n"); |
2303 | return rc; | 2293 | return rc; |
2304 | } | 2294 | } |
2305 | 2295 | ||