tty: stop using alloc_tty_driver
[linux-2.6-microblaze.git] / drivers / tty / ipwireless / tty.c
index 99bb2f1..d24404c 100644 (file)
@@ -54,7 +54,6 @@ struct ipw_tty {
        unsigned int control_lines;
        struct mutex ipw_tty_mutex;
        int tx_bytes_queued;
-       int closing;
 };
 
 static struct ipw_tty *ttys[IPWIRELESS_PCMCIA_MINORS];
@@ -228,7 +227,7 @@ static int ipw_write(struct tty_struct *linux_tty,
        return count;
 }
 
-static int ipw_write_room(struct tty_struct *linux_tty)
+static unsigned int ipw_write_room(struct tty_struct *linux_tty)
 {
        struct ipw_tty *tty = linux_tty->driver_data;
        int room;
@@ -270,7 +269,7 @@ static int ipwireless_set_serial_info(struct tty_struct *linux_tty,
        return 0;       /* Keeps the PCMCIA scripts happy. */
 }
 
-static int ipw_chars_in_buffer(struct tty_struct *linux_tty)
+static unsigned int ipw_chars_in_buffer(struct tty_struct *linux_tty)
 {
        struct ipw_tty *tty = linux_tty->driver_data;
 
@@ -525,7 +524,6 @@ void ipwireless_tty_free(struct ipw_tty *tty)
                                printk(KERN_INFO IPWIRELESS_PCCARD_NAME
                                       ": deregistering %s device ttyIPWp%d\n",
                                       tty_type_name(ttyj->tty_type), j);
-                       ttyj->closing = 1;
                        if (ttyj->port.tty != NULL) {
                                mutex_unlock(&ttyj->ipw_tty_mutex);
                                tty_vhangup(ttyj->port.tty);
@@ -566,9 +564,10 @@ int ipwireless_tty_init(void)
 {
        int result;
 
-       ipw_tty_driver = alloc_tty_driver(IPWIRELESS_PCMCIA_MINORS);
-       if (!ipw_tty_driver)
-               return -ENOMEM;
+       ipw_tty_driver = tty_alloc_driver(IPWIRELESS_PCMCIA_MINORS,
+                       TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV);
+       if (IS_ERR(ipw_tty_driver))
+               return PTR_ERR(ipw_tty_driver);
 
        ipw_tty_driver->driver_name = IPWIRELESS_PCCARD_NAME;
        ipw_tty_driver->name = "ttyIPWp";
@@ -576,7 +575,6 @@ int ipwireless_tty_init(void)
        ipw_tty_driver->minor_start = IPWIRELESS_PCMCIA_START;
        ipw_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
        ipw_tty_driver->subtype = SERIAL_TYPE_NORMAL;
-       ipw_tty_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
        ipw_tty_driver->init_termios = tty_std_termios;
        ipw_tty_driver->init_termios.c_cflag =
            B9600 | CS8 | CREAD | HUPCL | CLOCAL;