summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaotian Zhang <vulab@iscas.ac.cn>2025-11-17 12:07:10 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-11-26 13:11:51 +0100
commit57c8794693368a5df8014e4bbb7ef4016be119ed (patch)
tree23a5d4bca4a09d1e0392f44f837b5af54b3a21cb
parentd3210c8e88ee4132a5bb316ee96b09472db90572 (diff)
serial: icom: Convert PCIBIOS_* return codes to errnos
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@iscas.ac.cn> Link: https://patch.msgid.link/20251117040710.1544-1-vulab@iscas.ac.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/icom.c1
1 files changed, 1 insertions, 0 deletions
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;
}