[PATCH 3/4] serial: atmel: abort probe on atmel_serial_init_port failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/serial/atmel.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/serial/atmel.c b/drivers/serial/atmel.c
index 8394273f9f42..612265692f64 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 */
 
-- 
2.30.2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux