summaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/8250/8250_early.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2015-03-09 21:27:17 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-26 16:17:55 +0100
commitcd385e9a2a2daa7e74003f930886e4c1cdf032f4 (patch)
tree3ef3dfeaafeada0b1c859b6ebb386aaa78826c11 /drivers/tty/serial/8250/8250_early.c
parentserial: 8250_early: Assume uart already initialized if no baud option (diff)
downloadlinux-cd385e9a2a2daa7e74003f930886e4c1cdf032f4.tar.xz
linux-cd385e9a2a2daa7e74003f930886e4c1cdf032f4.zip
serial: 8250_early: Fix setup() error code
If parsing failed to decode a valid uart addr, return -ENODEV instead of success. Although setup_earlycon() will detect the failure anyway (because the write() method has not been set), that behavior is not obvious and should not be relied on. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/8250/8250_early.c')
-rw-r--r--drivers/tty/serial/8250/8250_early.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index 1701d00fd9f6..b199c10689f4 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -146,7 +146,7 @@ static int __init early_serial8250_setup(struct earlycon_device *device,
const char *options)
{
if (!(device->port.membase || device->port.iobase))
- return 0;
+ return -ENODEV;
if (!device->baud) {
struct uart_port *port = &device->port;