lkml.org 
[lkml]   [2021]   [Jan]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] serial: samsung: Checks the return value of function
Date
"uart_add_one_port" function call may fail and return
some error code, so adding a check for return value.
If it is returning some error code, then displaying the
result and returning back from there.

Signed-off-by: Tamseel Shams <m.shams@samsung.com>
---
drivers/tty/serial/samsung_tty.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 6ef614d8648c..a220ba166ffe 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -2072,7 +2072,11 @@ static int s3c24xx_serial_probe(struct platform_device *pdev)
}

dev_dbg(&pdev->dev, "%s: adding port\n", __func__);
- uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
+ ret = uart_add_one_port(&s3c24xx_uart_drv, &ourport->port);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "Failed to add uart port, err %d\n", ret);
+ return ret;
+ }
platform_set_drvdata(pdev, &ourport->port);

/*
--
2.17.1
\
 
 \ /
  Last update: 2021-01-04 10:57    [W:0.036 / U:0.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site