diff options
author | Maxime COQUELIN <maxime.coquelin@st.com> | 2014-07-24 14:02:55 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-27 11:05:08 -0700 |
commit | 5b4e79ae452613a9d391cf1e5ab7e9a49241ad28 (patch) | |
tree | 221208e8ee8463db4e48af705505c78712f4553d /drivers/tty | |
parent | af300539def51ef79be3cbc54379f1d86c1733ff (diff) |
serial: st-asc: Don't call BUG in asc_console_setup()
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 <maxime.coquelin@st.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/st-asc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c index 2bee4fbccba..4e9f4f29f3c 100644 --- a/drivers/tty/serial/st-asc.c +++ b/drivers/tty/serial/st-asc.c @@ -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); |