diff options
author | Joe Perches <joe@perches.com> | 2011-06-26 15:01:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-06-27 03:09:47 -0400 |
commit | 23efcb738ea51befe0674e0685fc6cfe353aa553 (patch) | |
tree | f5bbf62acc9bfa2b771b8ecb6ece5cbb771e9e98 /drivers/net/wan/sbni.c | |
parent | c75bb2c6f0cf455c23e60f14d780e841dd47f801 (diff) |
wan: Update to current logging forms
Use pr_fmt, pr_<level> and netdev_<level> as appropriate.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan/sbni.c')
-rw-r--r-- | drivers/net/wan/sbni.c | 67 |
1 files changed, 32 insertions, 35 deletions
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c index cff13a9597cd..40e95facdb6c 100644 --- a/drivers/net/wan/sbni.c +++ b/drivers/net/wan/sbni.c | |||
@@ -37,6 +37,8 @@ | |||
37 | * Known problem: this driver wasn't tested on multiprocessor machine. | 37 | * Known problem: this driver wasn't tested on multiprocessor machine. |
38 | */ | 38 | */ |
39 | 39 | ||
40 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
41 | |||
40 | #include <linux/module.h> | 42 | #include <linux/module.h> |
41 | #include <linux/kernel.h> | 43 | #include <linux/kernel.h> |
42 | #include <linux/ptrace.h> | 44 | #include <linux/ptrace.h> |
@@ -200,8 +202,8 @@ sbni_isa_probe( struct net_device *dev ) | |||
200 | 202 | ||
201 | return 0; | 203 | return 0; |
202 | else { | 204 | else { |
203 | printk( KERN_ERR "sbni: base address 0x%lx is busy, or adapter " | 205 | pr_err("base address 0x%lx is busy, or adapter is malfunctional!\n", |
204 | "is malfunctional!\n", dev->base_addr ); | 206 | dev->base_addr); |
205 | return -ENODEV; | 207 | return -ENODEV; |
206 | } | 208 | } |
207 | } | 209 | } |
@@ -226,7 +228,6 @@ static void __init sbni_devsetup(struct net_device *dev) | |||
226 | int __init sbni_probe(int unit) | 228 | int __init sbni_probe(int unit) |
227 | { | 229 | { |
228 | struct net_device *dev; | 230 | struct net_device *dev; |
229 | static unsigned version_printed __initdata = 0; | ||
230 | int err; | 231 | int err; |
231 | 232 | ||
232 | dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup); | 233 | dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup); |
@@ -250,8 +251,7 @@ int __init sbni_probe(int unit) | |||
250 | free_netdev(dev); | 251 | free_netdev(dev); |
251 | return err; | 252 | return err; |
252 | } | 253 | } |
253 | if( version_printed++ == 0 ) | 254 | pr_info_once("%s", version); |
254 | printk( KERN_INFO "%s", version ); | ||
255 | return 0; | 255 | return 0; |
256 | } | 256 | } |
257 | 257 | ||
@@ -326,9 +326,9 @@ sbni_pci_probe( struct net_device *dev ) | |||
326 | } | 326 | } |
327 | 327 | ||
328 | if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) | 328 | if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) |
329 | printk( KERN_WARNING | 329 | pr_warn( |
330 | " WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n" | 330 | "WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n" |
331 | " You should use the PCI BIOS setup to assign a valid IRQ line.\n", | 331 | "You should use the PCI BIOS setup to assign a valid IRQ line.\n", |
332 | pci_irq_line ); | 332 | pci_irq_line ); |
333 | 333 | ||
334 | /* avoiding re-enable dual adapters */ | 334 | /* avoiding re-enable dual adapters */ |
@@ -372,8 +372,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) | |||
372 | outb( 0, ioaddr + CSR0 ); | 372 | outb( 0, ioaddr + CSR0 ); |
373 | 373 | ||
374 | if( !irq ) { | 374 | if( !irq ) { |
375 | printk( KERN_ERR "%s: can't detect device irq!\n", | 375 | pr_err("%s: can't detect device irq!\n", dev->name); |
376 | dev->name ); | ||
377 | release_region( ioaddr, SBNI_IO_EXTENT ); | 376 | release_region( ioaddr, SBNI_IO_EXTENT ); |
378 | return NULL; | 377 | return NULL; |
379 | } | 378 | } |
@@ -386,7 +385,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) | |||
386 | /* Fill in sbni-specific dev fields. */ | 385 | /* Fill in sbni-specific dev fields. */ |
387 | nl = netdev_priv(dev); | 386 | nl = netdev_priv(dev); |
388 | if( !nl ) { | 387 | if( !nl ) { |
389 | printk( KERN_ERR "%s: unable to get memory!\n", dev->name ); | 388 | pr_err("%s: unable to get memory!\n", dev->name); |
390 | release_region( ioaddr, SBNI_IO_EXTENT ); | 389 | release_region( ioaddr, SBNI_IO_EXTENT ); |
391 | return NULL; | 390 | return NULL; |
392 | } | 391 | } |
@@ -415,21 +414,21 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) | |||
415 | if( inb( ioaddr + CSR0 ) & 0x01 ) | 414 | if( inb( ioaddr + CSR0 ) & 0x01 ) |
416 | nl->state |= FL_SLOW_MODE; | 415 | nl->state |= FL_SLOW_MODE; |
417 | 416 | ||
418 | printk( KERN_NOTICE "%s: ioaddr %#lx, irq %d, " | 417 | pr_notice("%s: ioaddr %#lx, irq %d, MAC: 00:ff:01:%02x:%02x:%02x\n", |
419 | "MAC: 00:ff:01:%02x:%02x:%02x\n", | 418 | dev->name, dev->base_addr, dev->irq, |
420 | dev->name, dev->base_addr, dev->irq, | 419 | ((u8 *)dev->dev_addr)[3], |
421 | ((u8 *) dev->dev_addr) [3], | 420 | ((u8 *)dev->dev_addr)[4], |
422 | ((u8 *) dev->dev_addr) [4], | 421 | ((u8 *)dev->dev_addr)[5]); |
423 | ((u8 *) dev->dev_addr) [5] ); | ||
424 | 422 | ||
425 | printk( KERN_NOTICE "%s: speed %d, receive level ", dev->name, | 423 | pr_notice("%s: speed %d", |
426 | ( (nl->state & FL_SLOW_MODE) ? 500000 : 2000000) | 424 | dev->name, |
427 | / (1 << nl->csr1.rate) ); | 425 | ((nl->state & FL_SLOW_MODE) ? 500000 : 2000000) |
426 | / (1 << nl->csr1.rate)); | ||
428 | 427 | ||
429 | if( nl->delta_rxl == 0 ) | 428 | if( nl->delta_rxl == 0 ) |
430 | printk( "0x%x (fixed)\n", nl->cur_rxl_index ); | 429 | pr_cont(", receive level 0x%x (fixed)\n", nl->cur_rxl_index); |
431 | else | 430 | else |
432 | printk( "(auto)\n"); | 431 | pr_cont(", receive level (auto)\n"); |
433 | 432 | ||
434 | #ifdef CONFIG_SBNI_MULTILINE | 433 | #ifdef CONFIG_SBNI_MULTILINE |
435 | nl->master = dev; | 434 | nl->master = dev; |
@@ -568,7 +567,7 @@ handle_channel( struct net_device *dev ) | |||
568 | */ | 567 | */ |
569 | csr0 = inb( ioaddr + CSR0 ); | 568 | csr0 = inb( ioaddr + CSR0 ); |
570 | if( !(csr0 & TR_RDY) || (csr0 & RC_RDY) ) | 569 | if( !(csr0 & TR_RDY) || (csr0 & RC_RDY) ) |
571 | printk( KERN_ERR "%s: internal error!\n", dev->name ); | 570 | netdev_err(dev, "internal error!\n"); |
572 | 571 | ||
573 | /* if state & FL_NEED_RESEND != 0 then tx_frameno != 0 */ | 572 | /* if state & FL_NEED_RESEND != 0 then tx_frameno != 0 */ |
574 | if( req_ans || nl->tx_frameno != 0 ) | 573 | if( req_ans || nl->tx_frameno != 0 ) |
@@ -851,7 +850,7 @@ prepare_to_send( struct sk_buff *skb, struct net_device *dev ) | |||
851 | 850 | ||
852 | /* nl->tx_buf_p == NULL here! */ | 851 | /* nl->tx_buf_p == NULL here! */ |
853 | if( nl->tx_buf_p ) | 852 | if( nl->tx_buf_p ) |
854 | printk( KERN_ERR "%s: memory leak!\n", dev->name ); | 853 | netdev_err(dev, "memory leak!\n"); |
855 | 854 | ||
856 | nl->outpos = 0; | 855 | nl->outpos = 0; |
857 | nl->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND); | 856 | nl->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND); |
@@ -1179,16 +1178,15 @@ sbni_open( struct net_device *dev ) | |||
1179 | 1178 | ||
1180 | ((struct net_local *) (netdev_priv(*p))) | 1179 | ((struct net_local *) (netdev_priv(*p))) |
1181 | ->second = dev; | 1180 | ->second = dev; |
1182 | printk( KERN_NOTICE "%s: using shared irq " | 1181 | netdev_notice(dev, "using shared irq with %s\n", |
1183 | "with %s\n", dev->name, (*p)->name ); | 1182 | (*p)->name); |
1184 | nl->state |= FL_SECONDARY; | 1183 | nl->state |= FL_SECONDARY; |
1185 | goto handler_attached; | 1184 | goto handler_attached; |
1186 | } | 1185 | } |
1187 | } | 1186 | } |
1188 | 1187 | ||
1189 | if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) { | 1188 | if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) { |
1190 | printk( KERN_ERR "%s: unable to get IRQ %d.\n", | 1189 | netdev_err(dev, "unable to get IRQ %d\n", dev->irq); |
1191 | dev->name, dev->irq ); | ||
1192 | return -EAGAIN; | 1190 | return -EAGAIN; |
1193 | } | 1191 | } |
1194 | 1192 | ||
@@ -1220,8 +1218,8 @@ sbni_close( struct net_device *dev ) | |||
1220 | struct net_local *nl = netdev_priv(dev); | 1218 | struct net_local *nl = netdev_priv(dev); |
1221 | 1219 | ||
1222 | if( nl->second && nl->second->flags & IFF_UP ) { | 1220 | if( nl->second && nl->second->flags & IFF_UP ) { |
1223 | printk( KERN_NOTICE "Secondary channel (%s) is active!\n", | 1221 | netdev_notice(dev, "Secondary channel (%s) is active!\n", |
1224 | nl->second->name ); | 1222 | nl->second->name); |
1225 | return -EBUSY; | 1223 | return -EBUSY; |
1226 | } | 1224 | } |
1227 | 1225 | ||
@@ -1363,8 +1361,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) | |||
1363 | return -EFAULT; | 1361 | return -EFAULT; |
1364 | slave_dev = dev_get_by_name(&init_net, slave_name ); | 1362 | slave_dev = dev_get_by_name(&init_net, slave_name ); |
1365 | if( !slave_dev || !(slave_dev->flags & IFF_UP) ) { | 1363 | if( !slave_dev || !(slave_dev->flags & IFF_UP) ) { |
1366 | printk( KERN_ERR "%s: trying to enslave non-active " | 1364 | netdev_err(dev, "trying to enslave non-active device %s\n", |
1367 | "device %s\n", dev->name, slave_name ); | 1365 | slave_name); |
1368 | return -EPERM; | 1366 | return -EPERM; |
1369 | } | 1367 | } |
1370 | 1368 | ||
@@ -1417,8 +1415,7 @@ enslave( struct net_device *dev, struct net_device *slave_dev ) | |||
1417 | 1415 | ||
1418 | spin_unlock( &snl->lock ); | 1416 | spin_unlock( &snl->lock ); |
1419 | spin_unlock( &nl->lock ); | 1417 | spin_unlock( &nl->lock ); |
1420 | printk( KERN_NOTICE "%s: slave device (%s) attached.\n", | 1418 | netdev_notice(dev, "slave device (%s) attached\n", slave_dev->name); |
1421 | dev->name, slave_dev->name ); | ||
1422 | return 0; | 1419 | return 0; |
1423 | } | 1420 | } |
1424 | 1421 | ||
@@ -1547,7 +1544,7 @@ sbni_setup( char *p ) | |||
1547 | break; | 1544 | break; |
1548 | } | 1545 | } |
1549 | bad_param: | 1546 | bad_param: |
1550 | printk( KERN_ERR "Error in sbni kernel parameter!\n" ); | 1547 | pr_err("Error in sbni kernel parameter!\n"); |
1551 | return 0; | 1548 | return 0; |
1552 | } | 1549 | } |
1553 | 1550 | ||