serial: clps711x: Return valid modem controls for port that not support it
authorAlexander Shiyan <shc_work@mail.ru>
Sun, 14 Oct 2012 07:05:28 +0000 (11:05 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Oct 2012 18:39:47 +0000 (11:39 -0700)
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/clps711x.c

index d37460965ba7bf800f2e00d29a4e4d94d7976cd4..7b0e539ee9c0e693bf1d218252f1768c0deb5b4a 100644 (file)
@@ -191,12 +191,9 @@ static unsigned int clps711xuart_tx_empty(struct uart_port *port)
 
 static unsigned int clps711xuart_get_mctrl(struct uart_port *port)
 {
-       unsigned int port_addr;
-       unsigned int result = 0;
-       unsigned int status;
+       unsigned int status, result = 0;
 
-       port_addr = SYSFLG(port);
-       if (port_addr == SYSFLG1) {
+       if (port->line == 0) {
                status = clps_readl(SYSFLG1);
                if (status & SYSFLG1_DCD)
                        result |= TIOCM_CAR;
@@ -204,7 +201,8 @@ static unsigned int clps711xuart_get_mctrl(struct uart_port *port)
                        result |= TIOCM_DSR;
                if (status & SYSFLG1_CTS)
                        result |= TIOCM_CTS;
-       }
+       } else
+               result = TIOCM_DSR | TIOCM_CTS | TIOCM_CAR;
 
        return result;
 }