m68knommu: Fix support for console port other than ttyS0 on mcf.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, April 3, 2009 - 11:02 am

Gitweb:     http://git.kernel.org/linus/4330e179a96bc9310d36e9b858bc8f275f329312
Commit:     4330e179a96bc9310d36e9b858bc8f275f329312
Parent:     c315bd5fdd2a949a9ccc22b2c64ee694602682d4
Author:     Len Sorensen <lsorense@csclub.uwaterloo.ca>
AuthorDate: Thu Feb 5 10:11:24 2009 +1000
Committer:  Greg Ungerer <gerg@uclinux.org>
CommitDate: Tue Mar 24 15:17:43 2009 +1000

    m68knommu: Fix support for console port other than ttyS0 on mcf.c
    
    Due to a case of backwards logic, mfc.c always makes the console port be
    ttyS0 even when you ask for another port.
    
    This patch fixes this issue.
    
    Only when the requested port is NOT in the range 0 to MAXPORTS-1 do we
    force it to be treated as if port 0 was requested.  Forcing the port to
    0 when it is in fact in the range 0 to MAXPORTS is not helpful.
    
    Tested with working console on ttyS2 on a 5271evb.
    
    Signed-off-by: Len Sorensen <lsorense@csclub.uwaterloo.ca>
    Signed-off-by: Greg Ungerer <gerg@uclinux.org>
---
 drivers/serial/mcf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/serial/mcf.c b/drivers/serial/mcf.c
index 56841fe..0eefb07 100644
--- a/drivers/serial/mcf.c
+++ b/drivers/serial/mcf.c
@@ -513,7 +513,7 @@ static int __init mcf_console_setup(struct console *co, char *options)
 	int parity = 'n';
 	int flow = 'n';
 
-	if ((co->index >= 0) && (co->index <= MCF_MAXPORTS))
+	if ((co->index < 0) || (co->index >= MCF_MAXPORTS))
 		co->index = 0;
 	port = &mcf_ports[co->index].port;
 	if (port->membase == 0)
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
m68knommu: Fix support for console port other than ttyS0 o ..., Linux Kernel Mailing ..., (Fri Apr 3, 11:02 am)