Commit 23efcb73 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

wan: Update to current logging forms

Use pr_fmt, pr_<level> and netdev_<level> as appropriate.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c75bb2c6
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* Generic HDLC port Copyright (C) 2008 Krzysztof Halasa <khc@pm.waw.pl> * 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/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -192,8 +194,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq) ...@@ -192,8 +194,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
*/ */
if (!request_region(iobase, 8, "Comtrol SV11")) { if (!request_region(iobase, 8, "Comtrol SV11")) {
printk(KERN_WARNING "hostess: I/O 0x%X already in use.\n", pr_warn("I/O 0x%X already in use\n", iobase);
iobase);
return NULL; return NULL;
} }
...@@ -221,7 +222,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq) ...@@ -221,7 +222,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
if (request_irq(irq, z8530_interrupt, IRQF_DISABLED, if (request_irq(irq, z8530_interrupt, IRQF_DISABLED,
"Hostess SV11", sv) < 0) { "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; goto err_irq;
} }
...@@ -255,7 +256,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq) ...@@ -255,7 +256,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
*/ */
if (z8530_init(sv)) { if (z8530_init(sv)) {
printk(KERN_ERR "Z8530 series device not found.\n"); pr_err("Z8530 series device not found\n");
enable_irq(irq); enable_irq(irq);
goto free_dma; goto free_dma;
} }
...@@ -282,7 +283,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq) ...@@ -282,7 +283,7 @@ static struct z8530_dev *sv11_init(int iobase, int irq)
netdev->irq = irq; netdev->irq = irq;
if (register_hdlc_device(netdev)) { 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); free_netdev(netdev);
goto free_dma; goto free_dma;
} }
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
* 2000-11-14 Henner Eisen dev_hold/put, NETDEV_GOING_DOWN support * 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/errno.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/socket.h> #include <linux/socket.h>
...@@ -165,13 +167,11 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb, ...@@ -165,13 +167,11 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb,
break; break;
case X25_IFACE_CONNECT: case X25_IFACE_CONNECT:
if ((err = lapb_connect_request(dev)) != LAPB_OK) if ((err = lapb_connect_request(dev)) != LAPB_OK)
printk(KERN_ERR "lapbeth: lapb_connect_request " pr_err("lapb_connect_request error: %d\n", err);
"error: %d\n", err);
goto drop; goto drop;
case X25_IFACE_DISCONNECT: case X25_IFACE_DISCONNECT:
if ((err = lapb_disconnect_request(dev)) != LAPB_OK) if ((err = lapb_disconnect_request(dev)) != LAPB_OK)
printk(KERN_ERR "lapbeth: lapb_disconnect_request " pr_err("lapb_disconnect_request err: %d\n", err);
"err: %d\n", err);
/* Fall thru */ /* Fall thru */
default: default:
goto drop; goto drop;
...@@ -180,7 +180,7 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb, ...@@ -180,7 +180,7 @@ static netdev_tx_t lapbeth_xmit(struct sk_buff *skb,
skb_pull(skb, 1); skb_pull(skb, 1);
if ((err = lapb_data_request(dev, skb)) != LAPB_OK) { 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; goto drop;
} }
out: out:
...@@ -220,7 +220,7 @@ static void lapbeth_connected(struct net_device *dev, int reason) ...@@ -220,7 +220,7 @@ static void lapbeth_connected(struct net_device *dev, int reason)
struct sk_buff *skb = dev_alloc_skb(1); struct sk_buff *skb = dev_alloc_skb(1);
if (!skb) { if (!skb) {
printk(KERN_ERR "lapbeth: out of memory\n"); pr_err("out of memory\n");
return; return;
} }
...@@ -237,7 +237,7 @@ static void lapbeth_disconnected(struct net_device *dev, int reason) ...@@ -237,7 +237,7 @@ static void lapbeth_disconnected(struct net_device *dev, int reason)
struct sk_buff *skb = dev_alloc_skb(1); struct sk_buff *skb = dev_alloc_skb(1);
if (!skb) { if (!skb) {
printk(KERN_ERR "lapbeth: out of memory\n"); pr_err("out of memory\n");
return; return;
} }
...@@ -277,7 +277,7 @@ static int lapbeth_open(struct net_device *dev) ...@@ -277,7 +277,7 @@ static int lapbeth_open(struct net_device *dev)
int err; int err;
if ((err = lapb_register(dev, &lapbeth_callbacks)) != LAPB_OK) { 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; return -ENODEV;
} }
...@@ -292,7 +292,7 @@ static int lapbeth_close(struct net_device *dev) ...@@ -292,7 +292,7 @@ static int lapbeth_close(struct net_device *dev)
netif_stop_queue(dev); netif_stop_queue(dev);
if ((err = lapb_unregister(dev)) != LAPB_OK) 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; return 0;
} }
......
...@@ -212,6 +212,8 @@ static const char rcsid[] = ...@@ -212,6 +212,8 @@ static const char rcsid[] =
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -3242,7 +3244,7 @@ static inline void show_version(void) ...@@ -3242,7 +3244,7 @@ static inline void show_version(void)
rcsdate++; rcsdate++;
tmp = strrchr(rcsdate, ' '); tmp = strrchr(rcsdate, ' ');
*tmp = '\0'; *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 */ } /* show_version */
static const struct net_device_ops cpc_netdev_ops = { static const struct net_device_ops cpc_netdev_ops = {
......
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
* Known problem: this driver wasn't tested on multiprocessor machine. * Known problem: this driver wasn't tested on multiprocessor machine.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
...@@ -200,8 +202,8 @@ sbni_isa_probe( struct net_device *dev ) ...@@ -200,8 +202,8 @@ sbni_isa_probe( struct net_device *dev )
return 0; return 0;
else { else {
printk( KERN_ERR "sbni: base address 0x%lx is busy, or adapter " pr_err("base address 0x%lx is busy, or adapter is malfunctional!\n",
"is malfunctional!\n", dev->base_addr ); dev->base_addr);
return -ENODEV; return -ENODEV;
} }
} }
...@@ -226,7 +228,6 @@ static void __init sbni_devsetup(struct net_device *dev) ...@@ -226,7 +228,6 @@ static void __init sbni_devsetup(struct net_device *dev)
int __init sbni_probe(int unit) int __init sbni_probe(int unit)
{ {
struct net_device *dev; struct net_device *dev;
static unsigned version_printed __initdata = 0;
int err; int err;
dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup); dev = alloc_netdev(sizeof(struct net_local), "sbni", sbni_devsetup);
...@@ -250,8 +251,7 @@ int __init sbni_probe(int unit) ...@@ -250,8 +251,7 @@ int __init sbni_probe(int unit)
free_netdev(dev); free_netdev(dev);
return err; return err;
} }
if( version_printed++ == 0 ) pr_info_once("%s", version);
printk( KERN_INFO "%s", version );
return 0; return 0;
} }
...@@ -326,9 +326,9 @@ sbni_pci_probe( struct net_device *dev ) ...@@ -326,9 +326,9 @@ sbni_pci_probe( struct net_device *dev )
} }
if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs)
printk( KERN_WARNING pr_warn(
" WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n" "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", "You should use the PCI BIOS setup to assign a valid IRQ line.\n",
pci_irq_line ); pci_irq_line );
/* avoiding re-enable dual adapters */ /* avoiding re-enable dual adapters */
...@@ -372,8 +372,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) ...@@ -372,8 +372,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
outb( 0, ioaddr + CSR0 ); outb( 0, ioaddr + CSR0 );
if( !irq ) { if( !irq ) {
printk( KERN_ERR "%s: can't detect device irq!\n", pr_err("%s: can't detect device irq!\n", dev->name);
dev->name );
release_region( ioaddr, SBNI_IO_EXTENT ); release_region( ioaddr, SBNI_IO_EXTENT );
return NULL; return NULL;
} }
...@@ -386,7 +385,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) ...@@ -386,7 +385,7 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
/* Fill in sbni-specific dev fields. */ /* Fill in sbni-specific dev fields. */
nl = netdev_priv(dev); nl = netdev_priv(dev);
if( !nl ) { 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 ); release_region( ioaddr, SBNI_IO_EXTENT );
return NULL; return NULL;
} }
...@@ -415,21 +414,21 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq ) ...@@ -415,21 +414,21 @@ sbni_probe1( struct net_device *dev, unsigned long ioaddr, int irq )
if( inb( ioaddr + CSR0 ) & 0x01 ) if( inb( ioaddr + CSR0 ) & 0x01 )
nl->state |= FL_SLOW_MODE; nl->state |= FL_SLOW_MODE;
printk( KERN_NOTICE "%s: ioaddr %#lx, irq %d, " pr_notice("%s: ioaddr %#lx, irq %d, MAC: 00:ff:01:%02x:%02x:%02x\n",
"MAC: 00:ff:01:%02x:%02x:%02x\n", dev->name, dev->base_addr, dev->irq,
dev->name, dev->base_addr, dev->irq, ((u8 *)dev->dev_addr)[3],
((u8 *) dev->dev_addr) [3], ((u8 *)dev->dev_addr)[4],
((u8 *) dev->dev_addr) [4], ((u8 *)dev->dev_addr)[5]);
((u8 *) dev->dev_addr) [5] );
printk( KERN_NOTICE "%s: speed %d, receive level ", dev->name, pr_notice("%s: speed %d",
( (nl->state & FL_SLOW_MODE) ? 500000 : 2000000) dev->name,
/ (1 << nl->csr1.rate) ); ((nl->state & FL_SLOW_MODE) ? 500000 : 2000000)
/ (1 << nl->csr1.rate));
if( nl->delta_rxl == 0 ) 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 else
printk( "(auto)\n"); pr_cont(", receive level (auto)\n");
#ifdef CONFIG_SBNI_MULTILINE #ifdef CONFIG_SBNI_MULTILINE
nl->master = dev; nl->master = dev;
...@@ -568,7 +567,7 @@ handle_channel( struct net_device *dev ) ...@@ -568,7 +567,7 @@ handle_channel( struct net_device *dev )
*/ */
csr0 = inb( ioaddr + CSR0 ); csr0 = inb( ioaddr + CSR0 );
if( !(csr0 & TR_RDY) || (csr0 & RC_RDY) ) 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 state & FL_NEED_RESEND != 0 then tx_frameno != 0 */
if( req_ans || nl->tx_frameno != 0 ) if( req_ans || nl->tx_frameno != 0 )
...@@ -851,7 +850,7 @@ prepare_to_send( struct sk_buff *skb, struct net_device *dev ) ...@@ -851,7 +850,7 @@ prepare_to_send( struct sk_buff *skb, struct net_device *dev )
/* nl->tx_buf_p == NULL here! */ /* nl->tx_buf_p == NULL here! */
if( nl->tx_buf_p ) if( nl->tx_buf_p )
printk( KERN_ERR "%s: memory leak!\n", dev->name ); netdev_err(dev, "memory leak!\n");
nl->outpos = 0; nl->outpos = 0;
nl->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND); nl->state &= ~(FL_WAIT_ACK | FL_NEED_RESEND);
...@@ -1179,16 +1178,15 @@ sbni_open( struct net_device *dev ) ...@@ -1179,16 +1178,15 @@ sbni_open( struct net_device *dev )
((struct net_local *) (netdev_priv(*p))) ((struct net_local *) (netdev_priv(*p)))
->second = dev; ->second = dev;
printk( KERN_NOTICE "%s: using shared irq " netdev_notice(dev, "using shared irq with %s\n",
"with %s\n", dev->name, (*p)->name ); (*p)->name);
nl->state |= FL_SECONDARY; nl->state |= FL_SECONDARY;
goto handler_attached; goto handler_attached;
} }
} }
if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) { if( request_irq(dev->irq, sbni_interrupt, IRQF_SHARED, dev->name, dev) ) {
printk( KERN_ERR "%s: unable to get IRQ %d.\n", netdev_err(dev, "unable to get IRQ %d\n", dev->irq);
dev->name, dev->irq );
return -EAGAIN; return -EAGAIN;
} }
...@@ -1220,8 +1218,8 @@ sbni_close( struct net_device *dev ) ...@@ -1220,8 +1218,8 @@ sbni_close( struct net_device *dev )
struct net_local *nl = netdev_priv(dev); struct net_local *nl = netdev_priv(dev);
if( nl->second && nl->second->flags & IFF_UP ) { if( nl->second && nl->second->flags & IFF_UP ) {
printk( KERN_NOTICE "Secondary channel (%s) is active!\n", netdev_notice(dev, "Secondary channel (%s) is active!\n",
nl->second->name ); nl->second->name);
return -EBUSY; return -EBUSY;
} }
...@@ -1363,8 +1361,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) ...@@ -1363,8 +1361,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
return -EFAULT; return -EFAULT;
slave_dev = dev_get_by_name(&init_net, slave_name ); slave_dev = dev_get_by_name(&init_net, slave_name );
if( !slave_dev || !(slave_dev->flags & IFF_UP) ) { if( !slave_dev || !(slave_dev->flags & IFF_UP) ) {
printk( KERN_ERR "%s: trying to enslave non-active " netdev_err(dev, "trying to enslave non-active device %s\n",
"device %s\n", dev->name, slave_name ); slave_name);
return -EPERM; return -EPERM;
} }
...@@ -1417,8 +1415,7 @@ enslave( struct net_device *dev, struct net_device *slave_dev ) ...@@ -1417,8 +1415,7 @@ enslave( struct net_device *dev, struct net_device *slave_dev )
spin_unlock( &snl->lock ); spin_unlock( &snl->lock );
spin_unlock( &nl->lock ); spin_unlock( &nl->lock );
printk( KERN_NOTICE "%s: slave device (%s) attached.\n", netdev_notice(dev, "slave device (%s) attached\n", slave_dev->name);
dev->name, slave_dev->name );
return 0; return 0;
} }
...@@ -1547,7 +1544,7 @@ sbni_setup( char *p ) ...@@ -1547,7 +1544,7 @@ sbni_setup( char *p )
break; break;
} }
bad_param: bad_param:
printk( KERN_ERR "Error in sbni kernel parameter!\n" ); pr_err("Error in sbni kernel parameter!\n");
return 0; return 0;
} }
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -190,7 +192,7 @@ static int slvl_setup(struct slvl_device *sv, int iobase, int irq) ...@@ -190,7 +192,7 @@ static int slvl_setup(struct slvl_device *sv, int iobase, int irq)
dev->irq = irq; dev->irq = irq;
if (register_hdlc_device(dev)) { 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); free_netdev(dev);
return -1; return -1;
} }
...@@ -215,8 +217,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq, ...@@ -215,8 +217,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
*/ */
if (!request_region(iobase, 8, "Sealevel 4021")) { if (!request_region(iobase, 8, "Sealevel 4021")) {
printk(KERN_WARNING "sealevel: I/O 0x%X already in use.\n", pr_warn("I/O 0x%X already in use\n", iobase);
iobase);
return NULL; return NULL;
} }
...@@ -267,7 +268,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq, ...@@ -267,7 +268,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
if (request_irq(irq, z8530_interrupt, IRQF_DISABLED, if (request_irq(irq, z8530_interrupt, IRQF_DISABLED,
"SeaLevel", dev) < 0) { "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; goto err_request_irq;
} }
...@@ -292,7 +293,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq, ...@@ -292,7 +293,7 @@ static __init struct slvl_board *slvl_init(int iobase, int irq,
*/ */
if (z8530_init(dev) != 0) { 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); enable_irq(irq);
goto free_hw; goto free_hw;
} }
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
* 2000-10-29 Henner Eisen lapb_data_indication() return status. * 2000-10-29 Henner Eisen lapb_data_indication() return status.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <asm/system.h> #include <asm/system.h>
...@@ -96,7 +98,7 @@ static struct x25_asy *x25_asy_alloc(void) ...@@ -96,7 +98,7 @@ static struct x25_asy *x25_asy_alloc(void)
x25_asy_devs[i] = dev; x25_asy_devs[i] = dev;
return sl; return sl;
} else { } else {
printk(KERN_WARNING "x25_asy_alloc() - register_netdev() failure.\n"); pr_warn("%s(): register_netdev() failure\n", __func__);
free_netdev(dev); free_netdev(dev);
} }
} }
...@@ -114,8 +116,7 @@ static void x25_asy_free(struct x25_asy *sl) ...@@ -114,8 +116,7 @@ static void x25_asy_free(struct x25_asy *sl)
sl->xbuff = NULL; sl->xbuff = NULL;
if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) if (!test_and_clear_bit(SLF_INUSE, &sl->flags))
printk(KERN_ERR "%s: x25_asy_free for already free unit.\n", netdev_err(sl->dev, "x25_asy_free for already free unit\n");
sl->dev->name);
} }
static int x25_asy_change_mtu(struct net_device *dev, int newmtu) static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
...@@ -128,8 +129,7 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu) ...@@ -128,8 +129,7 @@ static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
rbuff = kmalloc(len + 4, GFP_ATOMIC); rbuff = kmalloc(len + 4, GFP_ATOMIC);
if (xbuff == NULL || rbuff == NULL) { if (xbuff == NULL || rbuff == NULL) {
printk(KERN_WARNING "%s: unable to grow X.25 buffers, MTU change cancelled.\n", netdev_warn(dev, "unable to grow X.25 buffers, MTU change cancelled\n");
dev->name);
kfree(xbuff); kfree(xbuff);
kfree(rbuff); kfree(rbuff);
return -ENOMEM; return -ENOMEM;
...@@ -198,8 +198,7 @@ static void x25_asy_bump(struct x25_asy *sl) ...@@ -198,8 +198,7 @@ static void x25_asy_bump(struct x25_asy *sl)
skb = dev_alloc_skb(count+1); skb = dev_alloc_skb(count+1);
if (skb == NULL) { if (skb == NULL) {
printk(KERN_WARNING "%s: memory squeeze, dropping packet.\n", netdev_warn(sl->dev, "memory squeeze, dropping packet\n");
sl->dev->name);
dev->stats.rx_dropped++; dev->stats.rx_dropped++;
return; return;
} }
...@@ -287,9 +286,9 @@ static void x25_asy_timeout(struct net_device *dev) ...@@ -287,9 +286,9 @@ static void x25_asy_timeout(struct net_device *dev)
/* May be we must check transmitter timeout here ? /* May be we must check transmitter timeout here ?
* 14 Oct 1994 Dmitry Gorodchanin. * 14 Oct 1994 Dmitry Gorodchanin.
*/ */
printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, netdev_warn(dev, "transmit timed out, %s?\n",
(tty_chars_in_buffer(sl->tty) || sl->xleft) ? (tty_chars_in_buffer(sl->tty) || sl->xleft) ?
"bad line quality" : "driver error"); "bad line quality" : "driver error");
sl->xleft = 0; sl->xleft = 0;
clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags); clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
x25_asy_unlock(sl); x25_asy_unlock(sl);
...@@ -306,8 +305,7 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb, ...@@ -306,8 +305,7 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb,
int err; int err;
if (!netif_running(sl->dev)) { if (!netif_running(sl->dev)) {
printk(KERN_ERR "%s: xmit call when iface is down\n", netdev_err(dev, "xmit call when iface is down\n");
dev->name);
kfree_skb(skb); kfree_skb(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
...@@ -318,13 +316,15 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb, ...@@ -318,13 +316,15 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb,
case X25_IFACE_CONNECT: /* Connection request .. do nothing */ case X25_IFACE_CONNECT: /* Connection request .. do nothing */
err = lapb_connect_request(dev); err = lapb_connect_request(dev);
if (err != LAPB_OK) if (err != LAPB_OK)
printk(KERN_ERR "x25_asy: lapb_connect_request error - %d\n", err); netdev_err(dev, "lapb_connect_request error: %d\n",
err);
kfree_skb(skb); kfree_skb(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
case X25_IFACE_DISCONNECT: /* do nothing - hang up ?? */ case X25_IFACE_DISCONNECT: /* do nothing - hang up ?? */
err = lapb_disconnect_request(dev); err = lapb_disconnect_request(dev);
if (err != LAPB_OK) if (err != LAPB_OK)
printk(KERN_ERR "x25_asy: lapb_disconnect_request error - %d\n", err); netdev_err(dev, "lapb_disconnect_request error: %d\n",
err);
default: default:
kfree_skb(skb); kfree_skb(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
...@@ -343,7 +343,7 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb, ...@@ -343,7 +343,7 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb,
err = lapb_data_request(dev, skb); err = lapb_data_request(dev, skb);
if (err != LAPB_OK) { if (err != LAPB_OK) {
printk(KERN_ERR "x25_asy: lapb_data_request error - %d\n", err); netdev_err(dev, "lapb_data_request error: %d\n", err);
kfree_skb(skb); kfree_skb(skb);
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
...@@ -378,7 +378,7 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb) ...@@ -378,7 +378,7 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
spin_lock(&sl->lock); spin_lock(&sl->lock);
if (netif_queue_stopped(sl->dev) || sl->tty == NULL) { if (netif_queue_stopped(sl->dev) || sl->tty == NULL) {
spin_unlock(&sl->lock); spin_unlock(&sl->lock);
printk(KERN_ERR "x25_asy: tbusy drop\n"); netdev_err(dev, "tbusy drop\n");
kfree_skb(skb); kfree_skb(skb);
return; return;
} }
...@@ -404,7 +404,7 @@ static void x25_asy_connected(struct net_device *dev, int reason) ...@@ -404,7 +404,7 @@ static void x25_asy_connected(struct net_device *dev, int reason)
skb = dev_alloc_skb(1); skb = dev_alloc_skb(1);
if (skb == NULL) { if (skb == NULL) {
printk(KERN_ERR "x25_asy: out of memory\n"); netdev_err(dev, "out of memory\n");
return; return;
} }
...@@ -423,7 +423,7 @@ static void x25_asy_disconnected(struct net_device *dev, int reason) ...@@ -423,7 +423,7 @@ static void x25_asy_disconnected(struct net_device *dev, int reason)
skb = dev_alloc_skb(1); skb = dev_alloc_skb(1);
if (skb == NULL) { if (skb == NULL) {
printk(KERN_ERR "x25_asy: out of memory\n"); netdev_err(dev, "out of memory\n");
return; return;
} }
...@@ -603,8 +603,8 @@ static void x25_asy_close_tty(struct tty_struct *tty) ...@@ -603,8 +603,8 @@ static void x25_asy_close_tty(struct tty_struct *tty)
err = lapb_unregister(sl->dev); err = lapb_unregister(sl->dev);
if (err != LAPB_OK) if (err != LAPB_OK)
printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", pr_err("x25_asy_close: lapb_unregister error: %d\n",
err); err);
tty->disc_data = NULL; tty->disc_data = NULL;
sl->tty = NULL; sl->tty = NULL;
...@@ -782,14 +782,13 @@ static int __init init_x25_asy(void) ...@@ -782,14 +782,13 @@ static int __init init_x25_asy(void)
if (x25_asy_maxdev < 4) if (x25_asy_maxdev < 4)
x25_asy_maxdev = 4; /* Sanity */ x25_asy_maxdev = 4; /* Sanity */
printk(KERN_INFO "X.25 async: version 0.00 ALPHA " pr_info("X.25 async: version 0.00 ALPHA (dynamic channels, max=%d)\n",
"(dynamic channels, max=%d).\n", x25_asy_maxdev); x25_asy_maxdev);
x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device *), x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device *),
GFP_KERNEL); GFP_KERNEL);
if (!x25_asy_devs) { if (!x25_asy_devs) {
printk(KERN_WARNING "X25 async: Can't allocate x25_asy_ctrls[] " pr_warn("Can't allocate x25_asy_ctrls[] array! Uaargh! (-> No X.25 available)\n");
"array! Uaargh! (-> No X.25 available)\n");
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
* Synchronous mode without DMA is unlikely to pass about 2400 baud. * Synchronous mode without DMA is unlikely to pass about 2400 baud.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/mm.h> #include <linux/mm.h>
...@@ -365,7 +367,7 @@ static void z8530_rx(struct z8530_channel *c) ...@@ -365,7 +367,7 @@ static void z8530_rx(struct z8530_channel *c)
c->count=0; c->count=0;
if(stat&Rx_OVR) if(stat&Rx_OVR)
{ {
printk(KERN_WARNING "%s: overrun\n", c->dev->name); pr_warn("%s: overrun\n", c->dev->name);
c->rx_overrun++; c->rx_overrun++;
} }
if(stat&CRC_ERR) if(stat&CRC_ERR)
...@@ -464,12 +466,12 @@ static void z8530_status(struct z8530_channel *chan) ...@@ -464,12 +466,12 @@ static void z8530_status(struct z8530_channel *chan)
if (altered & chan->dcdcheck) if (altered & chan->dcdcheck)
{ {
if (status & chan->dcdcheck) { if (status & chan->dcdcheck) {
printk(KERN_INFO "%s: DCD raised\n", chan->dev->name); pr_info("%s: DCD raised\n", chan->dev->name);
write_zsreg(chan, R3, chan->regs[3] | RxENABLE); write_zsreg(chan, R3, chan->regs[3] | RxENABLE);
if (chan->netdevice) if (chan->netdevice)
netif_carrier_on(chan->netdevice); netif_carrier_on(chan->netdevice);
} else { } else {
printk(KERN_INFO "%s: DCD lost\n", chan->dev->name); pr_info("%s: DCD lost\n", chan->dev->name);
write_zsreg(chan, R3, chan->regs[3] & ~RxENABLE); write_zsreg(chan, R3, chan->regs[3] & ~RxENABLE);
z8530_flush_fifo(chan); z8530_flush_fifo(chan);
if (chan->netdevice) if (chan->netdevice)
...@@ -538,12 +540,12 @@ static void z8530_dma_tx(struct z8530_channel *chan) ...@@ -538,12 +540,12 @@ static void z8530_dma_tx(struct z8530_channel *chan)
{ {
if(!chan->dma_tx) if(!chan->dma_tx)
{ {
printk(KERN_WARNING "Hey who turned the DMA off?\n"); pr_warn("Hey who turned the DMA off?\n");
z8530_tx(chan); z8530_tx(chan);
return; return;
} }
/* This shouldn't occur in DMA mode */ /* This shouldn't occur in DMA mode */
printk(KERN_ERR "DMA tx - bogus event!\n"); pr_err("DMA tx - bogus event!\n");
z8530_tx(chan); z8530_tx(chan);
} }
...@@ -585,12 +587,12 @@ static void z8530_dma_status(struct z8530_channel *chan) ...@@ -585,12 +587,12 @@ static void z8530_dma_status(struct z8530_channel *chan)
if (altered & chan->dcdcheck) if (altered & chan->dcdcheck)
{ {
if (status & chan->dcdcheck) { if (status & chan->dcdcheck) {
printk(KERN_INFO "%s: DCD raised\n", chan->dev->name); pr_info("%s: DCD raised\n", chan->dev->name);
write_zsreg(chan, R3, chan->regs[3] | RxENABLE); write_zsreg(chan, R3, chan->regs[3] | RxENABLE);
if (chan->netdevice) if (chan->netdevice)
netif_carrier_on(chan->netdevice); netif_carrier_on(chan->netdevice);
} else { } else {
printk(KERN_INFO "%s:DCD lost\n", chan->dev->name); pr_info("%s: DCD lost\n", chan->dev->name);
write_zsreg(chan, R3, chan->regs[3] & ~RxENABLE); write_zsreg(chan, R3, chan->regs[3] & ~RxENABLE);
z8530_flush_fifo(chan); z8530_flush_fifo(chan);
if (chan->netdevice) if (chan->netdevice)
...@@ -712,7 +714,7 @@ irqreturn_t z8530_interrupt(int irq, void *dev_id) ...@@ -712,7 +714,7 @@ irqreturn_t z8530_interrupt(int irq, void *dev_id)
if(locker) if(locker)
{ {
printk(KERN_ERR "IRQ re-enter\n"); pr_err("IRQ re-enter\n");
return IRQ_NONE; return IRQ_NONE;
} }
locker=1; locker=1;
...@@ -758,7 +760,8 @@ irqreturn_t z8530_interrupt(int irq, void *dev_id) ...@@ -758,7 +760,8 @@ irqreturn_t z8530_interrupt(int irq, void *dev_id)
} }
spin_unlock(&dev->lock); spin_unlock(&dev->lock);
if(work==5000) if(work==5000)
printk(KERN_ERR "%s: interrupt jammed - abort(0x%X)!\n", dev->name, intr); pr_err("%s: interrupt jammed - abort(0x%X)!\n",
dev->name, intr);
/* Ok all done */ /* Ok all done */
locker=0; locker=0;
return IRQ_HANDLED; return IRQ_HANDLED;
...@@ -1225,7 +1228,7 @@ static const char *z8530_type_name[]={ ...@@ -1225,7 +1228,7 @@ static const char *z8530_type_name[]={
void z8530_describe(struct z8530_dev *dev, char *mapping, unsigned long io) void z8530_describe(struct z8530_dev *dev, char *mapping, unsigned long io)
{ {
printk(KERN_INFO "%s: %s found at %s 0x%lX, IRQ %d.\n", pr_info("%s: %s found at %s 0x%lX, IRQ %d\n",
dev->name, dev->name,
z8530_type_name[dev->type], z8530_type_name[dev->type],
mapping, mapping,
...@@ -1621,8 +1624,7 @@ static void z8530_rx_done(struct z8530_channel *c) ...@@ -1621,8 +1624,7 @@ static void z8530_rx_done(struct z8530_channel *c)
else else
/* Can't occur as we dont reenable the DMA irq until /* Can't occur as we dont reenable the DMA irq until
after the flip is done */ after the flip is done */
printk(KERN_WARNING "%s: DMA flip overrun!\n", netdev_warn(c->netdevice, "DMA flip overrun!\n");
c->netdevice->name);
release_dma_lock(flags); release_dma_lock(flags);
...@@ -1637,8 +1639,7 @@ static void z8530_rx_done(struct z8530_channel *c) ...@@ -1637,8 +1639,7 @@ static void z8530_rx_done(struct z8530_channel *c)
skb = dev_alloc_skb(ct); skb = dev_alloc_skb(ct);
if (skb == NULL) { if (skb == NULL) {
c->netdevice->stats.rx_dropped++; c->netdevice->stats.rx_dropped++;
printk(KERN_WARNING "%s: Memory squeeze.\n", netdev_warn(c->netdevice, "Memory squeeze\n");
c->netdevice->name);
} else { } else {
skb_put(skb, ct); skb_put(skb, ct);
skb_copy_to_linear_data(skb, rxb, ct); skb_copy_to_linear_data(skb, rxb, ct);
...@@ -1678,8 +1679,7 @@ static void z8530_rx_done(struct z8530_channel *c) ...@@ -1678,8 +1679,7 @@ static void z8530_rx_done(struct z8530_channel *c)
c->skb2 = dev_alloc_skb(c->mtu); c->skb2 = dev_alloc_skb(c->mtu);
if (c->skb2 == NULL) if (c->skb2 == NULL)
printk(KERN_WARNING "%s: memory squeeze.\n", netdev_warn(c->netdevice, "memory squeeze\n");
c->netdevice->name);
else else
skb_put(c->skb2, c->mtu); skb_put(c->skb2, c->mtu);
c->netdevice->stats.rx_packets++; c->netdevice->stats.rx_packets++;
...@@ -1693,7 +1693,7 @@ static void z8530_rx_done(struct z8530_channel *c) ...@@ -1693,7 +1693,7 @@ static void z8530_rx_done(struct z8530_channel *c)
c->rx_function(c, skb); c->rx_function(c, skb);
} else { } else {
c->netdevice->stats.rx_dropped++; c->netdevice->stats.rx_dropped++;
printk(KERN_ERR "%s: Lost a frame\n", c->netdevice->name); netdev_err(c->netdevice, "Lost a frame\n");
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment