summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2016-09-24 16:36:10 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2019-11-25 14:54:19 +0000
commitbb10e64dbd1307d73cae36ac9444f8faad03109a (patch)
tree6e5c83a43845fb3680b61f7bc50cab1d2b04701b
parent8b532a09029d82b3ae687ec0e4f9779691340804 (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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/tty/serial/sa1100.c b/drivers/tty/serial/sa1100.c
index 8e618129e65c..ac497418615f 100644
--- a/drivers/tty/serial/sa1100.c
+++ b/drivers/tty/serial/sa1100.c
@@ -885,7 +885,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)
@@ -896,12 +896,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)