Skip to content

Commit

Permalink
serial: st-asc: Don't call BUG in asc_console_setup()
Browse files Browse the repository at this point in the history
In order to prevent an asc instance to be used as early console, BUG_ON is
used on either mapbase or membase being NULL.

Problem is that this condition is also true when we set console to be a ttyASx
different to the first asc instance being probed.

Instead of calling BUG_ON, it now returns -ENXIO when either mapbase or
membase is NULL.

Signed-off-by: Maxime Coquelin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
mcoquelin-stm32 authored and gregkh committed Jul 27, 2014
1 parent af30053 commit 5b4e79a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/tty/serial/st-asc.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ static int asc_console_setup(struct console *co, char *options)
* this to be called during the uart port registration when the
* driver gets probed and the port should be mapped at that point.
*/
BUG_ON(ascport->port.mapbase == 0 || ascport->port.membase == NULL);
if (ascport->port.mapbase == 0 || ascport->port.membase == NULL)
return -ENXIO;

if (options)
uart_parse_options(options, &baud, &parity, &bits, &flow);
Expand Down

0 comments on commit 5b4e79a

Please sign in to comment.