Skip to content

Commit

Permalink
[SERIAL] sunsab: Fix E250 console with RSC.
Browse files Browse the repository at this point in the history
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 <marvin@mydatex.cz>

Signed-off-by: Marc Zyngier <maz@misterjones.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Marc Zyngier authored and David S. Miller committed Aug 23, 2006
1 parent 25848c4 commit 0f4184f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/serial/sunsab.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 0f4184f

Please sign in to comment.