From 0f4184f73d5233214d3225a94fcf1bd4d6678d74 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Wed, 23 Aug 2006 15:50:57 -0700 Subject: [PATCH] [SERIAL] sunsab: Fix E250 console with RSC. This fixes yet another sunsab problem, when console is set to anything but the first port. The console framework calls sunsab_console_setup for each port, and we end up setting up a console on a not yet discovered port, which leads to an Oops. Instead, defer console setup until the requested port is properly initialized. Tested on an E250 through an RSC console. Reported by Daniel Smolik Signed-off-by: Marc Zyngier Signed-off-by: David S. Miller --- drivers/serial/sunsab.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index dc673e1..cfe20f7 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c @@ -886,6 +886,15 @@ static int sunsab_console_setup(struct console *con, char *options) unsigned long flags; unsigned int baud, quot; + /* + * The console framework calls us for each and every port + * registered. Defer the console setup until the requested + * port has been properly discovered. A bit of a hack, + * though... + */ + if (up->port.type != PORT_SUNSAB) + return -1; + printk("Console: ttyS%d (SAB82532)\n", (sunsab_reg.minor - 64) + con->index); -- 2.7.4