diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2016-09-24 16:36:10 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2020-10-12 21:55:35 +0100 |
commit | 80913a024c1263090d44515dba40ab7a69d72700 (patch) | |
tree | c500a5dccf75f48ee83379056101bda3eee50686 | |
parent | d8a82543fd2c951ec17f980f7c1c259090ddfde3 (diff) |
tty: serial: sa1100: fix error handing in sa1100_serial_probe()
We need to propagate the error code from sa1100_serial_add_one_port()
so that we don't ignore a probe deferral or other error which may
prevent us binding the port.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | drivers/tty/serial/sa1100.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c index 75c2a22895f9..4c0052f37cbf 100644 --- a/drivers/tty/serial/sa1100.c +++ b/drivers/tty/serial/sa1100.c @@ -880,7 +880,7 @@ static int sa1100_serial_add_one_port(struct sa1100_port *sport, struct platform static int sa1100_serial_probe(struct platform_device *dev) { struct resource *res = dev->resource; - int i; + int i, ret = -ENODEV; for (i = 0; i < dev->num_resources; i++, res++) if (res->flags & IORESOURCE_MEM) @@ -891,12 +891,12 @@ static int sa1100_serial_probe(struct platform_device *dev) if (sa1100_ports[i].port.mapbase != res->start) continue; - sa1100_serial_add_one_port(&sa1100_ports[i], dev); + ret = sa1100_serial_add_one_port(&sa1100_ports[i], dev); break; } } - return 0; + return ret; } static int sa1100_serial_remove(struct platform_device *pdev) |