Skip to content

Commit

Permalink
wan: Update to current logging forms
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
JoePerches authored and davem330 committed Jun 27, 2011
1 parent c75bb2c commit 23efcb7
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 96 deletions.
11 changes: 6 additions & 5 deletions drivers/net/wan/hostess_sv11.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* Generic HDLC port Copyright (C) 2008 Krzysztof Halasa <khc@pm.waw.pl>
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
Expand Down Expand Up @@ -192,8 +194,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
*/

if (!request_region(iobase, 8, "Comtrol SV11")) {
printk(KERN_WARNING "hostess: I/O 0x%X already in use.\n",
iobase);
pr_warn("I/O 0x%X already in use\n", iobase);
return NULL;
}

Expand Down Expand Up @@ -221,7 +222,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)

if (request_irq(irq, z8530_interrupt, IRQF_DISABLED,
"Hostess SV11", sv) < 0) {
printk(KERN_WARNING "hostess: IRQ %d already in use.\n", irq);
pr_warn("IRQ %d already in use\n", irq);
goto err_irq;
}

Expand Down Expand Up @@ -255,7 +256,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
*/

if (z8530_init(sv)) {
printk(KERN_ERR "Z8530 series device not found.\n");
pr_err("Z8530 series device not found\n");
enable_irq(irq);
goto free_dma;
}
Expand All @@ -282,7 +283,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
netdev->irq = irq;

if (register_hdlc_device(netdev)) {
printk(KERN_ERR "hostess: unable to register HDLC device.\n");
pr_err("unable to register HDLC device\n");
free_netdev(netdev);
goto free_dma;
}
Expand Down
18 changes: 9 additions & 9 deletions drivers/net/wan/lapbether.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
* 2000-11-14 Henner Eisen dev_hold/put, NETDEV_GOING_DOWN support
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/errno.h>
#include <linux/types.h>
#include <linux/socket.h>
Expand Down Expand Up @@ -165,13 +167,11 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb,
break;
case X25_IFACE_CONNECT:
if ((err = lapb_connect_request(dev)) != LAPB_OK)
printk(KERN_ERR "lapbeth: lapb_connect_request "
"error: %d\n", err);
pr_err("lapb_connect_request error: %d\n", err);
goto drop;
case X25_IFACE_DISCONNECT:
if ((err = lapb_disconnect_request(dev)) != LAPB_OK)
printk(KERN_ERR "lapbeth: lapb_disconnect_request "
"err: %d\n", err);
pr_err("lapb_disconnect_request err: %d\n", err);
/* Fall thru */
default:
goto drop;
Expand All @@ -180,7 +180,7 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb,
skb_pull(skb, 1);

if ((err = lapb_data_request(dev, skb)) != LAPB_OK) {
printk(KERN_ERR "lapbeth: lapb_data_request error - %d\n", err);
pr_err("lapb_data_request error - %d\n", err);
goto drop;
}
out:
Expand Down Expand Up @@ -220,7 +220,7 @@ static void lapbeth_connected(struct net_device *dev, int reason)
struct sk_buff *skb = dev_alloc_skb(1);

if (!skb) {
printk(KERN_ERR "lapbeth: out of memory\n");
pr_err("out of memory\n");
return;
}

Expand All @@ -237,7 +237,7 @@ static void lapbeth_disconnected(struct net_device *dev, int reason)
struct sk_buff *skb = dev_alloc_skb(1);

if (!skb) {
printk(KERN_ERR "lapbeth: out of memory\n");
pr_err("out of memory\n");
return;
}

Expand Down Expand Up @@ -277,7 +277,7 @@ static int lapbeth_open(struct net_device *dev)
int err;

if ((err = lapb_register(dev, &lapbeth_callbacks)) != LAPB_OK) {
printk(KERN_ERR "lapbeth: lapb_register error - %d\n", err);
pr_err("lapb_register error: %d\n", err);
return -ENODEV;
}

Expand All @@ -292,7 +292,7 @@ static int lapbeth_close(struct net_device *dev)
netif_stop_queue(dev);

if ((err = lapb_unregister(dev)) != LAPB_OK)
printk(KERN_ERR "lapbeth: lapb_unregister error - %d\n", err);
pr_err("lapb_unregister error: %d\n", err);

return 0;
}
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/wan/pc300_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ static const char rcsid[] =
*
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
Expand Down Expand Up @@ -3242,7 +3244,7 @@ static inline void show_version(void)
rcsdate++;
tmp = strrchr(rcsdate, ' ');
*tmp = '\0';
printk(KERN_INFO "Cyclades-PC300 driver %s %s\n", rcsvers, rcsdate);
pr_info("Cyclades-PC300 driver %s %s\n", rcsvers, rcsdate);
} /* show_version */

static const struct net_device_ops cpc_netdev_ops = {
Expand Down
67 changes: 32 additions & 35 deletions drivers/net/wan/sbni.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
* Known problem: this driver wasn't tested on multiprocessor machine.
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/ptrace.h>
Expand Down Expand Up @@ -200,8 +202,8 @@ sbni_isa_probe( struct net_device *dev )

return 0;
else {
printk( KERN_ERR "sbni: base address 0x%lx is busy, or adapter "
"is malfunctional!\n", dev->base_addr );
pr_err("base address 0x%lx is busy, or adapter is malfunctional!\n",
dev->base_addr);
return -ENODEV;
}
}
Expand All @@ -226,7 +228,6 @@ static void __init sbni_devsetup(struct net_device *dev)
int __init sbni_probe(int unit)
{
struct net_device *dev;
static unsigned version_printed __initdata = 0;
int err;

dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup);
Expand All @@ -250,8 +251,7 @@ int __init sbni_probe(int unit)
free_netdev(dev);
return err;
}
if( version_printed++ == 0 )
printk( KERN_INFO "%s", version );
pr_info_once("%s", version);
return 0;
}

Expand Down Expand Up @@ -326,9 +326,9 @@ sbni_pci_probe( struct net_device *dev )
}

if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs)
printk( KERN_WARNING
" WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n"
" You should use the PCI BIOS setup to assign a valid IRQ line.\n",
pr_warn(
"WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n"
"You should use the PCI BIOS setup to assign a valid IRQ line.\n",
pci_irq_line );

/* avoiding re-enable dual adapters */
Expand Down Expand Up @@ -372,8 +372,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
outb( 0, ioaddr + CSR0 );

if( !irq ) {
printk( KERN_ERR "%s: can't detect device irq!\n",
dev->name );
pr_err("%s: can't detect device irq!\n", dev->name);
release_region( ioaddr, SBNI_IO_EXTENT );
return NULL;
}
Expand All @@ -386,7 +385,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
/* Fill in sbni-specific dev fields. */
nl = netdev_priv(dev);
if( !nl ) {
printk( KERN_ERR "%s: unable to get memory!\n", dev->name );
pr_err("%s: unable to get memory!\n", dev->name);
release_region( ioaddr, SBNI_IO_EXTENT );
return NULL;
}
Expand Down Expand Up @@ -415,21 +414,21 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
if( inb( ioaddr + CSR0 ) & 0x01 )
nl->state |= FL_SLOW_MODE;

printk( KERN_NOTICE "%s: ioaddr %#lx, irq %d, "
"MAC: 00:ff:01:%02x:%02x:%02x\n",
dev->name, dev->base_addr, dev->irq,
((u8 *) dev->dev_addr) [3],
((u8 *) dev->dev_addr) [4],
((u8 *) dev->dev_addr) [5] );
pr_notice("%s: ioaddr %#lx, irq %d, MAC: 00:ff:01:%02x:%02x:%02x\n",
dev->name, dev->base_addr, dev->irq,
((u8 *)dev->dev_addr)[3],
((u8 *)dev->dev_addr)[4],
((u8 *)dev->dev_addr)[5]);

printk( KERN_NOTICE "%s: speed %d, receive level ", dev->name,
( (nl->state & FL_SLOW_MODE) ? 500000 : 2000000)
/ (1 << nl->csr1.rate) );
pr_notice("%s: speed %d",
dev->name,
((nl->state & FL_SLOW_MODE) ? 500000 : 2000000)
/ (1 << nl->csr1.rate));

if( nl->delta_rxl == 0 )
printk( "0x%x (fixed)\n", nl->cur_rxl_index );
pr_cont(", receive level 0x%x (fixed)\n", nl->cur_rxl_index);
else
printk( "(auto)\n");
pr_cont(", receive level (auto)\n");

#ifdef CONFIG_SBNI_MULTILINE
nl->master = dev;
Expand Down Expand Up @@ -568,7 +567,7 @@ handle_channel( struct net_device *dev )
*/
csr0 = inb( ioaddr + CSR0 );
if( !(csr0 & TR_RDY) || (csr0 & RC_RDY) )
printk( KERN_ERR "%s: internal error!\n", dev->name );
netdev_err(dev, "internal error!\n");

/* if state & FL_NEED_RESEND != 0 then tx_frameno != 0 */
if( req_ans || nl->tx_frameno != 0 )
Expand Down Expand Up @@ -851,7 +850,7 @@ prepare_to_send( struct sk_buff *skb, struct net_device *dev )

/* nl->tx_buf_p == NULL here! */
if( nl->tx_buf_p )
printk( KERN_ERR "%s: memory leak!\n", dev->name );
netdev_err(dev, "memory leak!\n");

nl->outpos = 0;
nl->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND);
Expand Down Expand Up @@ -1179,16 +1178,15 @@ sbni_open( struct net_device *dev )

((struct net_local *) (netdev_priv(*p)))
->second = dev;
printk( KERN_NOTICE "%s: using shared irq "
"with %s\n", dev->name, (*p)->name );
netdev_notice(dev, "using shared irq with %s\n",
(*p)->name);
nl->state |= FL_SECONDARY;
goto handler_attached;
}
}

if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) {
printk( KERN_ERR "%s: unable to get IRQ %d.\n",
dev->name, dev->irq );
netdev_err(dev, "unable to get IRQ %d\n", dev->irq);
return -EAGAIN;
}

Expand Down Expand Up @@ -1220,8 +1218,8 @@ sbni_close( struct net_device *dev )
struct net_local *nl = netdev_priv(dev);

if( nl->second && nl->second->flags & IFF_UP ) {
printk( KERN_NOTICE "Secondary channel (%s) is active!\n",
nl->second->name );
netdev_notice(dev, "Secondary channel (%s) is active!\n",
nl->second->name);
return -EBUSY;
}

Expand Down Expand Up @@ -1363,8 +1361,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
return -EFAULT;
slave_dev = dev_get_by_name(&init_net, slave_name );
if( !slave_dev || !(slave_dev->flags & IFF_UP) ) {
printk( KERN_ERR "%s: trying to enslave non-active "
"device %s\n", dev->name, slave_name );
netdev_err(dev, "trying to enslave non-active device %s\n",
slave_name);
return -EPERM;
}

Expand Down Expand Up @@ -1417,8 +1415,7 @@ enslave( struct net_device *dev, struct net_device *slave_dev )

spin_unlock( &snl->lock );
spin_unlock( &nl->lock );
printk( KERN_NOTICE "%s: slave device (%s) attached.\n",
dev->name, slave_dev->name );
netdev_notice(dev, "slave device (%s) attached\n", slave_dev->name);
return 0;
}

Expand Down Expand Up @@ -1547,7 +1544,7 @@ sbni_setup( char *p )
break;
}
bad_param:
printk( KERN_ERR "Error in sbni kernel parameter!\n" );
pr_err("Error in sbni kernel parameter!\n");
return 0;
}

Expand Down
11 changes: 6 additions & 5 deletions drivers/net/wan/sealevel.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*
*/

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/mm.h>
Expand Down Expand Up @@ -190,7 +192,7 @@ static int slvl_setup(struct slvl_device *sv, int iobase, int irq)
dev->irq = irq;

if (register_hdlc_device(dev)) {
printk(KERN_ERR "sealevel: unable to register HDLC device\n");
pr_err("unable to register HDLC device\n");
free_netdev(dev);
return -1;
}
Expand All @@ -215,8 +217,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
*/

if (!request_region(iobase, 8, "Sealevel 4021")) {
printk(KERN_WARNING "sealevel: I/O 0x%X already in use.\n",
iobase);
pr_warn("I/O 0x%X already in use\n", iobase);
return NULL;
}

Expand Down Expand Up @@ -267,7 +268,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,

if (request_irq(irq, z8530_interrupt, IRQF_DISABLED,
"SeaLevel", dev) < 0) {
printk(KERN_WARNING "sealevel: IRQ %d already in use.\n", irq);
pr_warn("IRQ %d already in use\n", irq);
goto err_request_irq;
}

Expand All @@ -292,7 +293,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
*/

if (z8530_init(dev) != 0) {
printk(KERN_ERR "Z8530 series device not found.\n");
pr_err("Z8530 series device not found\n");
enable_irq(irq);
goto free_hw;
}
Expand Down
Loading

0 comments on commit 23efcb7

Please sign in to comment.