diff options
Diffstat (limited to 'drivers/net/wan/x25_asy.c')
-rw-r--r-- | drivers/net/wan/x25_asy.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index d81ad8397885..24297b274cd4 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
@@ -498,7 +498,6 @@ norbuff: | |||
498 | static int x25_asy_close(struct net_device *dev) | 498 | static int x25_asy_close(struct net_device *dev) |
499 | { | 499 | { |
500 | struct x25_asy *sl = netdev_priv(dev); | 500 | struct x25_asy *sl = netdev_priv(dev); |
501 | int err; | ||
502 | 501 | ||
503 | spin_lock(&sl->lock); | 502 | spin_lock(&sl->lock); |
504 | if (sl->tty) | 503 | if (sl->tty) |
@@ -507,10 +506,6 @@ static int x25_asy_close(struct net_device *dev) | |||
507 | netif_stop_queue(dev); | 506 | netif_stop_queue(dev); |
508 | sl->rcount = 0; | 507 | sl->rcount = 0; |
509 | sl->xleft = 0; | 508 | sl->xleft = 0; |
510 | err = lapb_unregister(dev); | ||
511 | if (err != LAPB_OK) | ||
512 | printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", | ||
513 | err); | ||
514 | spin_unlock(&sl->lock); | 509 | spin_unlock(&sl->lock); |
515 | return 0; | 510 | return 0; |
516 | } | 511 | } |
@@ -582,7 +577,7 @@ static int x25_asy_open_tty(struct tty_struct *tty) | |||
582 | if (err) | 577 | if (err) |
583 | return err; | 578 | return err; |
584 | /* Done. We have linked the TTY line to a channel. */ | 579 | /* Done. We have linked the TTY line to a channel. */ |
585 | return sl->dev->base_addr; | 580 | return 0; |
586 | } | 581 | } |
587 | 582 | ||
588 | 583 | ||
@@ -595,6 +590,7 @@ static int x25_asy_open_tty(struct tty_struct *tty) | |||
595 | static void x25_asy_close_tty(struct tty_struct *tty) | 590 | static void x25_asy_close_tty(struct tty_struct *tty) |
596 | { | 591 | { |
597 | struct x25_asy *sl = tty->disc_data; | 592 | struct x25_asy *sl = tty->disc_data; |
593 | int err; | ||
598 | 594 | ||
599 | /* First make sure we're connected. */ | 595 | /* First make sure we're connected. */ |
600 | if (!sl || sl->magic != X25_ASY_MAGIC) | 596 | if (!sl || sl->magic != X25_ASY_MAGIC) |
@@ -605,6 +601,11 @@ static void x25_asy_close_tty(struct tty_struct *tty) | |||
605 | dev_close(sl->dev); | 601 | dev_close(sl->dev); |
606 | rtnl_unlock(); | 602 | rtnl_unlock(); |
607 | 603 | ||
604 | err = lapb_unregister(sl->dev); | ||
605 | if (err != LAPB_OK) | ||
606 | printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", | ||
607 | err); | ||
608 | |||
608 | tty->disc_data = NULL; | 609 | tty->disc_data = NULL; |
609 | sl->tty = NULL; | 610 | sl->tty = NULL; |
610 | x25_asy_free(sl); | 611 | x25_asy_free(sl); |