aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan/x25_asy.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wan/x25_asy.c')
-rw-r--r--drivers/net/wan/x25_asy.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 24297b274cd4..46ceb3ae9073 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -14,6 +14,8 @@
14 * 2000-10-29 Henner Eisen lapb_data_indication() return status. 14 * 2000-10-29 Henner Eisen lapb_data_indication() return status.
15 */ 15 */
16 16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
17#include <linux/module.h> 19#include <linux/module.h>
18 20
19#include <asm/system.h> 21#include <asm/system.h>
@@ -96,7 +98,7 @@ static struct x25_asy *x25_asy_alloc(void)
96 x25_asy_devs[i] = dev; 98 x25_asy_devs[i] = dev;
97 return sl; 99 return sl;
98 } else { 100 } else {
99 printk(KERN_WARNING "x25_asy_alloc() - register_netdev() failure.\n"); 101 pr_warn("%s(): register_netdev() failure\n", __func__);
100 free_netdev(dev); 102 free_netdev(dev);
101 } 103 }
102 } 104 }
@@ -114,8 +116,7 @@ static void x25_asy_free(struct x25_asy *sl)
114 sl->xbuff = NULL; 116 sl->xbuff = NULL;
115 117
116 if (!test_and_clear_bit(SLF_INUSE, &sl->flags)) 118 if (!test_and_clear_bit(SLF_INUSE, &sl->flags))
117 printk(KERN_ERR "%s: x25_asy_free for already free unit.\n", 119 netdev_err(sl->dev, "x25_asy_free for already free unit\n");
118 sl->dev->name);
119} 120}
120 121
121static int x25_asy_change_mtu(struct net_device *dev, int newmtu) 122static 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 rbuff = kmalloc(len + 4, GFP_ATOMIC); 129 rbuff = kmalloc(len + 4, GFP_ATOMIC);
129 130
130 if (xbuff == NULL || rbuff == NULL) { 131 if (xbuff == NULL || rbuff == NULL) {
131 printk(KERN_WARNING "%s: unable to grow X.25 buffers, MTU change cancelled.\n", 132 netdev_warn(dev, "unable to grow X.25 buffers, MTU change cancelled\n");
132 dev->name);
133 kfree(xbuff); 133 kfree(xbuff);
134 kfree(rbuff); 134 kfree(rbuff);
135 return -ENOMEM; 135 return -ENOMEM;
@@ -198,8 +198,7 @@ static void x25_asy_bump(struct x25_asy *sl)
198 198
199 skb = dev_alloc_skb(count+1); 199 skb = dev_alloc_skb(count+1);
200 if (skb == NULL) { 200 if (skb == NULL) {
201 printk(KERN_WARNING "%s: memory squeeze, dropping packet.\n", 201 netdev_warn(sl->dev, "memory squeeze, dropping packet\n");
202 sl->dev->name);
203 dev->stats.rx_dropped++; 202 dev->stats.rx_dropped++;
204 return; 203 return;
205 } 204 }
@@ -287,9 +286,9 @@ static void x25_asy_timeout(struct net_device *dev)
287 /* May be we must check transmitter timeout here ? 286 /* May be we must check transmitter timeout here ?
288 * 14 Oct 1994 Dmitry Gorodchanin. 287 * 14 Oct 1994 Dmitry Gorodchanin.
289 */ 288 */
290 printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, 289 netdev_warn(dev, "transmit timed out, %s?\n",
291 (tty_chars_in_buffer(sl->tty) || sl->xleft) ? 290 (tty_chars_in_buffer(sl->tty) || sl->xleft) ?
292 "bad line quality" : "driver error"); 291 "bad line quality" : "driver error");
293 sl->xleft = 0; 292 sl->xleft = 0;
294 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags); 293 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
295 x25_asy_unlock(sl); 294 x25_asy_unlock(sl);
@@ -306,8 +305,7 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb,
306 int err; 305 int err;
307 306
308 if (!netif_running(sl->dev)) { 307 if (!netif_running(sl->dev)) {
309 printk(KERN_ERR "%s: xmit call when iface is down\n", 308 netdev_err(dev, "xmit call when iface is down\n");
310 dev->name);
311 kfree_skb(skb); 309 kfree_skb(skb);
312 return NETDEV_TX_OK; 310 return NETDEV_TX_OK;
313 } 311 }
@@ -318,13 +316,15 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb,
318 case X25_IFACE_CONNECT: /* Connection request .. do nothing */ 316 case X25_IFACE_CONNECT: /* Connection request .. do nothing */
319 err = lapb_connect_request(dev); 317 err = lapb_connect_request(dev);
320 if (err != LAPB_OK) 318 if (err != LAPB_OK)
321 printk(KERN_ERR "x25_asy: lapb_connect_request error - %d\n", err); 319 netdev_err(dev, "lapb_connect_request error: %d\n",
320 err);
322 kfree_skb(skb); 321 kfree_skb(skb);
323 return NETDEV_TX_OK; 322 return NETDEV_TX_OK;
324 case X25_IFACE_DISCONNECT: /* do nothing - hang up ?? */ 323 case X25_IFACE_DISCONNECT: /* do nothing - hang up ?? */
325 err = lapb_disconnect_request(dev); 324 err = lapb_disconnect_request(dev);
326 if (err != LAPB_OK) 325 if (err != LAPB_OK)
327 printk(KERN_ERR "x25_asy: lapb_disconnect_request error - %d\n", err); 326 netdev_err(dev, "lapb_disconnect_request error: %d\n",
327 err);
328 default: 328 default:
329 kfree_skb(skb); 329 kfree_skb(skb);
330 return NETDEV_TX_OK; 330 return NETDEV_TX_OK;
@@ -343,7 +343,7 @@ static netdev_tx_t x25_asy_xmit(struct sk_buff *skb,
343 343
344 err = lapb_data_request(dev, skb); 344 err = lapb_data_request(dev, skb);
345 if (err != LAPB_OK) { 345 if (err != LAPB_OK) {
346 printk(KERN_ERR "x25_asy: lapb_data_request error - %d\n", err); 346 netdev_err(dev, "lapb_data_request error: %d\n", err);
347 kfree_skb(skb); 347 kfree_skb(skb);
348 return NETDEV_TX_OK; 348 return NETDEV_TX_OK;
349 } 349 }
@@ -378,7 +378,7 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
378 spin_lock(&sl->lock); 378 spin_lock(&sl->lock);
379 if (netif_queue_stopped(sl->dev) || sl->tty == NULL) { 379 if (netif_queue_stopped(sl->dev) || sl->tty == NULL) {
380 spin_unlock(&sl->lock); 380 spin_unlock(&sl->lock);
381 printk(KERN_ERR "x25_asy: tbusy drop\n"); 381 netdev_err(dev, "tbusy drop\n");
382 kfree_skb(skb); 382 kfree_skb(skb);
383 return; 383 return;
384 } 384 }
@@ -404,7 +404,7 @@ static void x25_asy_connected(struct net_device *dev, int reason)
404 404
405 skb = dev_alloc_skb(1); 405 skb = dev_alloc_skb(1);
406 if (skb == NULL) { 406 if (skb == NULL) {
407 printk(KERN_ERR "x25_asy: out of memory\n"); 407 netdev_err(dev, "out of memory\n");
408 return; 408 return;
409 } 409 }
410 410
@@ -423,7 +423,7 @@ static void x25_asy_disconnected(struct net_device *dev, int reason)
423 423
424 skb = dev_alloc_skb(1); 424 skb = dev_alloc_skb(1);
425 if (skb == NULL) { 425 if (skb == NULL) {
426 printk(KERN_ERR "x25_asy: out of memory\n"); 426 netdev_err(dev, "out of memory\n");
427 return; 427 return;
428 } 428 }
429 429
@@ -603,8 +603,8 @@ static void x25_asy_close_tty(struct tty_struct *tty)
603 603
604 err = lapb_unregister(sl->dev); 604 err = lapb_unregister(sl->dev);
605 if (err != LAPB_OK) 605 if (err != LAPB_OK)
606 printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", 606 pr_err("x25_asy_close: lapb_unregister error: %d\n",
607 err); 607 err);
608 608
609 tty->disc_data = NULL; 609 tty->disc_data = NULL;
610 sl->tty = NULL; 610 sl->tty = NULL;
@@ -782,14 +782,13 @@ static int __init init_x25_asy(void)
782 if (x25_asy_maxdev < 4) 782 if (x25_asy_maxdev < 4)
783 x25_asy_maxdev = 4; /* Sanity */ 783 x25_asy_maxdev = 4; /* Sanity */
784 784
785 printk(KERN_INFO "X.25 async: version 0.00 ALPHA " 785 pr_info("X.25 async: version 0.00 ALPHA (dynamic channels, max=%d)\n",
786 "(dynamic channels, max=%d).\n", x25_asy_maxdev); 786 x25_asy_maxdev);
787 787
788 x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device *), 788 x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device *),
789 GFP_KERNEL); 789 GFP_KERNEL);
790 if (!x25_asy_devs) { 790 if (!x25_asy_devs) {
791 printk(KERN_WARNING "X25 async: Can't allocate x25_asy_ctrls[] " 791 pr_warn("Can't allocate x25_asy_ctrls[] array! Uaargh! (-> No X.25 available)\n");
792 "array! Uaargh! (-> No X.25 available)\n");
793 return -ENOMEM; 792 return -ENOMEM;
794 } 793 }
795 794