]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
serial: bfin-uart: Enable hardware automatic CTS only when CTS pin is available.
authorSonic Zhang <sonic.zhang@analog.com>
Tue, 13 Dec 2011 04:22:01 +0000 (12:22 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 13 Dec 2011 17:50:15 +0000 (09:50 -0800)
Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/tty/serial/bfin_uart.c

index abac23741057142f6fc789e7abc6a17a0ff4cba1..dedd9ab06d82669ed5f2a58a1f7125f115630c7e 100644 (file)
@@ -726,16 +726,17 @@ static int bfin_serial_startup(struct uart_port *port)
        }
 #endif
 #ifdef CONFIG_SERIAL_BFIN_HARD_CTSRTS
-       if (uart->cts_pin >= 0 && request_irq(uart->status_irq,
-               bfin_serial_mctrl_cts_int,
-               0, "BFIN_UART_MODEM_STATUS", uart)) {
-               uart->cts_pin = -1;
-               pr_info("Unable to attach BlackFin UART Modem Status interrupt.\n");
-       }
+       if (uart->cts_pin >= 0) {
+               if (request_irq(uart->status_irq, bfin_serial_mctrl_cts_int,
+                       IRQF_DISABLED, "BFIN_UART_MODEM_STATUS", uart)) {
+                       uart->cts_pin = -1;
+                       dev_info(port->dev, "Unable to attach BlackFin UART Modem Status interrupt.\n");
+               }
 
-       /* CTS RTS PINs are negative assertive. */
-       UART_PUT_MCR(uart, ACTS);
-       UART_SET_IER(uart, EDSSI);
+               /* CTS RTS PINs are negative assertive. */
+               UART_PUT_MCR(uart, ACTS);
+               UART_SET_IER(uart, EDSSI);
+       }
 #endif
 
        UART_SET_IER(uart, ERBFI);