serial: pch_uart: fix sysrq handling for pch_uart
authorLiang Li <liang.li@windriver.com>
Thu, 24 Jan 2013 04:31:27 +0000 (12:31 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Jan 2013 16:52:23 +0000 (08:52 -0800)
When PCH_UART_CONSOLE and SERIAL_CORE_CONSOLE is not set neither, the
uart_port will have no 'sysrq' member hence their will need a '#ifdef'
in pch_uart.c to handle the case, otherwise we'll see compile error
like this:

  CC [M]  drivers/tty/serial/pch_uart.o
drivers/tty/serial/pch_uart.c: In function 'pch_uart_hal_read':
drivers/tty/serial/pch_uart.c:572:11: error: 'struct uart_port' has no member named 'sysrq'
make[4]: *** [drivers/tty/serial/pch_uart.o] Error 1

Reported-by: Randy Dunlap <rdunlap@infradead.org>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Liang Li <liang.li@windriver.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/pch_uart.c

index 1ddfc66b108468b98d735148515a5e82adbcdfc8..7a6c989924b3e955d738abaa7049011d12d64c69 100644 (file)
@@ -569,10 +569,12 @@ static int pch_uart_hal_read(struct eg20t_port *priv, unsigned char *buf,
                        if (uart_handle_break(port))
                                continue;
                }
+#ifdef SUPPORT_SYSRQ
                if (port->sysrq) {
                        if (uart_handle_sysrq_char(port, rbr))
                                continue;
                }
+#endif
 
                buf[i++] = rbr;
        }