lkml.org 
[lkml]   [2021]   [Mar]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 13/44] tty: 8250/serial_cs, propagate errors in simple_config
Date
The caller expects from the others (pfc_config and multi_config) to
return standard error values. So do the same for simple_config too.

We invert the if condition to handle the error case.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
drivers/tty/serial/8250/serial_cs.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 35ff6627c61b..63ea9c4da3d5 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -456,11 +456,11 @@ static int simple_config(struct pcmcia_device *link)
* its base address, then try to grab any standard serial port
* address, and finally try to get any free port.
*/
- if (!pcmcia_loop_config(link, simple_config_check_notpicky, NULL))
- goto found_port;
-
- dev_warn(&link->dev, "no usable port range found, giving up\n");
- return -1;
+ ret = pcmcia_loop_config(link, simple_config_check_notpicky, NULL);
+ if (ret) {
+ dev_warn(&link->dev, "no usable port range found, giving up\n");
+ return ret;
+ }

found_port:
if (info->multi && (info->manfid == MANFID_3COM))
@@ -474,7 +474,7 @@ static int simple_config(struct pcmcia_device *link)

ret = pcmcia_enable_device(link);
if (ret != 0)
- return -1;
+ return ret;
return setup_serial(link, info, link->resource[0]->start, link->irq);
}

--
2.30.1
\
 
 \ /
  Last update: 2021-03-02 16:10    [W:0.212 / U:0.952 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site