[PATCH] serial: icom: Convert PCIBIOS_* return codes to errnos

From: Haotian Zhang

Date: Sun Nov 16 2025 - 23:09:14 EST


icom_probe() uses pci_read_config_dword() that returns PCIBIOS_*
codes. The return code is returned from the probe function as is but
probe functions should return normal errnos. A proper implementation
can be found in drivers/leds/leds-ss4200.c

Convert PCIBIOS_* return codes using pcibios_err_to_errno() into
normal errno before returning them.

Signed-off-by: Haotian Zhang <vulab@xxxxxxxxxxx>
---
drivers/tty/serial/icom.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c
index 7fb995a8490e..566c05511b0f 100644
--- a/drivers/tty/serial/icom.c
+++ b/drivers/tty/serial/icom.c
@@ -1723,6 +1723,7 @@ static int icom_probe(struct pci_dev *dev,
retval = pci_read_config_dword(dev, PCI_COMMAND, &command_reg);
if (retval) {
dev_err(&dev->dev, "PCI Config read FAILED\n");
+ retval = pcibios_err_to_errno(retval);
goto probe_exit0;
}

--
2.50.1.windows.1