public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fix support for console port other than ttyS0 on mcf.c
@ 2009-02-04 20:15 Lennart Sorensen
  2009-02-04 20:20 ` Lennart Sorensen
  0 siblings, 1 reply; 9+ messages in thread
From: Lennart Sorensen @ 2009-02-04 20:15 UTC (permalink / raw)
  To: linux-kernel

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>

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)

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-02-05 23:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-04 20:15 Fix support for console port other than ttyS0 on mcf.c Lennart Sorensen
2009-02-04 20:20 ` Lennart Sorensen
2009-02-04 21:00   ` Geert Uytterhoeven
2009-02-05  0:24     ` [uClinux-dev] " Greg Ungerer
2009-02-05 15:27     ` Lennart Sorensen
2009-02-05 15:53       ` Geert Uytterhoeven
2009-02-05 15:57         ` Lennart Sorensen
2009-02-05 16:36           ` Geert Uytterhoeven
2009-02-05 23:45             ` [uClinux-dev] " Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox