[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240829085316.3144246-1-yujiaoliang@vivo.com>
Date: Thu, 29 Aug 2024 16:53:16 +0800
From: Yu Jiaoliang <yujiaoliang@...o.com>
To: Jacky Huang <ychuang3@...oton.com>,
Shan-Chun Hung <schung@...oton.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org
Cc: opensource.kernel@...o.com
Subject: [PATCH v1] tty: serial: ma35d1: Simplify with dev_err_probe()
Error handling in probe() can be a bit simpler with dev_err_probe().
Signed-off-by: Yu Jiaoliang <yujiaoliang@...o.com>
---
drivers/tty/serial/ma35d1_serial.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/ma35d1_serial.c b/drivers/tty/serial/ma35d1_serial.c
index 3b4206e815fe..09d42a4054b3 100644
--- a/drivers/tty/serial/ma35d1_serial.c
+++ b/drivers/tty/serial/ma35d1_serial.c
@@ -692,10 +692,9 @@ static int ma35d1serial_probe(struct platform_device *pdev)
return -ENODEV;
ret = of_alias_get_id(pdev->dev.of_node, "serial");
- if (ret < 0) {
- dev_err(&pdev->dev, "failed to get alias/pdev id, errno %d\n", ret);
- return ret;
- }
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret, "failed to get alias/pdev id\n");
+
up = &ma35d1serial_ports[ret];
up->port.line = ret;
res_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
--
2.34.1
Powered by blists - more mailing lists