tty: 8250/serial_cs, propagate errors in simple_config

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>
Link: https://lore.kernel.org/r/20210302062214.29627-13-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jiri Slaby 2021-03-02 07:21:43 +01:00 committed by Greg Kroah-Hartman
parent 7e3d3c08f1
commit 7a9ca63298

View file

@ -456,11 +456,11 @@ static int simple_config(struct pcmcia_device *link)
* its base address, then try to grab any standard serial port * its base address, then try to grab any standard serial port
* address, and finally try to get any free port. * address, and finally try to get any free port.
*/ */
if (!pcmcia_loop_config(link, simple_config_check_notpicky, NULL)) ret = pcmcia_loop_config(link, simple_config_check_notpicky, NULL);
goto found_port; if (ret) {
dev_warn(&link->dev, "no usable port range found, giving up\n");
dev_warn(&link->dev, "no usable port range found, giving up\n"); return ret;
return -1; }
found_port: found_port:
if (info->multi && (info->manfid == MANFID_3COM)) if (info->multi && (info->manfid == MANFID_3COM))
@ -474,7 +474,7 @@ static int simple_config(struct pcmcia_device *link)
ret = pcmcia_enable_device(link); ret = pcmcia_enable_device(link);
if (ret != 0) if (ret != 0)
return -1; return ret;
return setup_serial(link, info, link->resource[0]->start, link->irq); return setup_serial(link, info, link->resource[0]->start, link->irq);
} }