]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/blobdiff - drivers/tty/serial/serial_core.c
Merge branch 'p-ti-linux-3.8.y' into p-ti-android-3.8.y
[android-sdk/kernel-video.git] / drivers / tty / serial / serial_core.c
index aa2e85dc1e2251e29e32af6f06ca15bc55f7c902..cbbd11a0722f8b5793fc1dbefd6b54af9d178273 100644 (file)
@@ -50,12 +50,6 @@ static struct lock_class_key port_lock_key;
 
 #define HIGH_BITS_OFFSET       ((sizeof(long)-sizeof(int))*8)
 
 
 #define HIGH_BITS_OFFSET       ((sizeof(long)-sizeof(int))*8)
 
-#ifdef CONFIG_SERIAL_CORE_CONSOLE
-#define uart_console(port)     ((port)->cons && (port)->cons->index == (port)->line)
-#else
-#define uart_console(port)     (0)
-#endif
-
 static void uart_change_speed(struct tty_struct *tty, struct uart_state *state,
                                        struct ktermios *old_termios);
 static void uart_wait_until_sent(struct tty_struct *tty, int timeout);
 static void uart_change_speed(struct tty_struct *tty, struct uart_state *state,
                                        struct ktermios *old_termios);
 static void uart_wait_until_sent(struct tty_struct *tty, int timeout);
@@ -1943,6 +1937,8 @@ int uart_suspend_port(struct uart_driver *drv, struct uart_port *uport)
                mutex_unlock(&port->mutex);
                return 0;
        }
                mutex_unlock(&port->mutex);
                return 0;
        }
+       put_device(tty_dev);
+
        if (console_suspend_enabled || !uart_console(uport))
                uport->suspended = 1;
 
        if (console_suspend_enabled || !uart_console(uport))
                uport->suspended = 1;
 
@@ -2008,9 +2004,11 @@ int uart_resume_port(struct uart_driver *drv, struct uart_port *uport)
                        disable_irq_wake(uport->irq);
                        uport->irq_wake = 0;
                }
                        disable_irq_wake(uport->irq);
                        uport->irq_wake = 0;
                }
+               put_device(tty_dev);
                mutex_unlock(&port->mutex);
                return 0;
        }
                mutex_unlock(&port->mutex);
                return 0;
        }
+       put_device(tty_dev);
        uport->suspended = 0;
 
        /*
        uport->suspended = 0;
 
        /*