]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/wan/x25_asy.c
[MIPS] rbtx4938: minor cleanup
[linux-2.6-omap-h63xx.git] / drivers / net / wan / x25_asy.c
index 1c9edd97accd679a816a66aa6e2a8cbb422c6d30..0f8aca8a4d4331b484226f749f6f33012c1a9cf3 100644 (file)
@@ -572,9 +572,7 @@ static int x25_asy_open_tty(struct tty_struct *tty)
        if (tty->driver->flush_buffer)  {
                tty->driver->flush_buffer(tty);
        }
-       if (tty->ldisc.flush_buffer)  {
-               tty->ldisc.flush_buffer(tty);
-       }
+       tty_ldisc_flush(tty);
 
        /* Restore default settings */
        sl->dev->type = ARPHRD_X25;
@@ -719,12 +717,8 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
                return 0;
        case SIOCSIFHWADDR:
                return -EINVAL;
-       /* Allow stty to read, but not set, the serial port */
-       case TCGETS:
-       case TCGETA:
-               return n_tty_ioctl(tty, file, cmd, arg);
        default:
-               return -ENOIOCTLCMD;
+               return tty_mode_ioctl(tty, file, cmd, arg);
        }
 }
 
@@ -786,14 +780,12 @@ static int __init init_x25_asy(void)
        printk(KERN_INFO "X.25 async: version 0.00 ALPHA "
                        "(dynamic channels, max=%d).\n", x25_asy_maxdev );
 
-       x25_asy_devs = kmalloc(sizeof(struct net_device *)*x25_asy_maxdev, 
-                              GFP_KERNEL);
+       x25_asy_devs = kcalloc(x25_asy_maxdev, sizeof(struct net_device*), GFP_KERNEL);
        if (!x25_asy_devs) {
                printk(KERN_WARNING "X25 async: Can't allocate x25_asy_ctrls[] "
                                "array! Uaargh! (-> No X.25 available)\n");
                return -ENOMEM;
        }
-       memset(x25_asy_devs, 0, sizeof(struct net_device *)*x25_asy_maxdev); 
 
        return tty_register_ldisc(N_X25, &x25_ldisc);
 }