Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
[pandora-kernel.git] / drivers / char / mxser_new.c
index 4c80549..9af07e4 100644 (file)
@@ -853,9 +853,9 @@ static int mxser_startup(struct mxser_port *info)
         * and set the speed of the serial port
         */
        mxser_change_speed(info, NULL);
+       info->flags |= ASYNC_INITIALIZED;
        spin_unlock_irqrestore(&info->slock, flags);
 
-       info->flags |= ASYNC_INITIALIZED;
        return 0;
 }
 
@@ -925,11 +925,9 @@ static void mxser_shutdown(struct mxser_port *info)
 static int mxser_open(struct tty_struct *tty, struct file *filp)
 {
        struct mxser_port *info;
+       unsigned long flags;
        int retval, line;
 
-       /* initialize driver_data in case something fails */
-       tty->driver_data = NULL;
-
        line = tty->index;
        if (line == MXSER_PORTS)
                return 0;
@@ -944,7 +942,9 @@ static int mxser_open(struct tty_struct *tty, struct file *filp)
        /*
         * Start up serial port
         */
+       spin_lock_irqsave(&info->slock, flags);
        info->count++;
+       spin_unlock_irqrestore(&info->slock, flags);
        retval = mxser_startup(info);
        if (retval)
                return retval;
@@ -1708,7 +1708,7 @@ static int mxser_ioctl(struct tty_struct *tty, struct file *file,
 
                info->speed = speed;
                spin_lock_irqsave(&info->slock, flags);
-               mxser_change_speed(info, 0);
+               mxser_change_speed(info, NULL);
                spin_unlock_irqrestore(&info->slock, flags);
 
                return 0;