summaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2021-10-30 19:54:45 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-11-01 11:28:41 +0100
commitb25654c862e0030884476f96ee92e107bf9d270c (patch)
treeded6b11aa1bfee31eef774dae60eac7f001e2399 /drivers/serial
parent67c0711a791f03dd56e0e28185aa333262955a48 (diff)
downloadbarebox-b25654c862e0030884476f96ee92e107bf9d270c.tar.gz
barebox-b25654c862e0030884476f96ee92e107bf9d270c.tar.xz
serial: atmel: abort probe on atmel_serial_init_port failure
The port initialization fails if the memory region couldn't be requested or if the clock couldn't be gotten. Both print an error message, so users running into this would've noticed. Do the sane thing and abort the probe in such error cases. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20211030175446.2274194-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/atmel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/serial/atmel.c b/drivers/serial/atmel.c
index 8394273f9f..612265692f 100644
--- a/drivers/serial/atmel.c
+++ b/drivers/serial/atmel.c
@@ -427,6 +427,7 @@ static int atmel_serial_probe(struct device_d *dev)
{
struct atmel_uart_port *uart;
struct console_device *cdev;
+ int ret;
uart = xzalloc(sizeof(struct atmel_uart_port));
cdev = &uart->uart;
@@ -438,7 +439,9 @@ static int atmel_serial_probe(struct device_d *dev)
cdev->set_mode = atmel_serial_set_mode;
cdev->linux_console_name = "ttyAT";
- atmel_serial_init_port(cdev);
+ ret = atmel_serial_init_port(cdev);
+ if (ret)
+ return ret;
/* Enable UART */