From: Peter Korsgaard Date: Fri, 22 Dec 2006 15:38:40 +0000 (+0100) Subject: [PATCH] serial/uartlite: Only enable port if request_port succeeded X-Git-Tag: v2.6.20-rc2~11 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e21654a756177bf209d7a3cbe971f16104555f75;p=linux-2.6 [PATCH] serial/uartlite: Only enable port if request_port succeeded The uartlite driver used to always enable the port even if request_port failed causing havoc. This patch fixes it. Signed-off-by: Peter Korsgaard Signed-off-by: Linus Torvalds --- diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index 92eba89355..db8607e3d5 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c @@ -278,8 +278,8 @@ static int ulite_request_port(struct uart_port *port) static void ulite_config_port(struct uart_port *port, int flags) { - ulite_request_port(port); - port->type = PORT_UARTLITE; + if (!ulite_request_port(port)) + port->type = PORT_UARTLITE; } static int ulite_verify_port(struct uart_port *port, struct serial_struct *ser)