]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
serial: icom: Convert PCIBIOS_* return codes to errnos
authorHaotian Zhang <vulab@iscas.ac.cn>
Mon, 17 Nov 2025 04:07:10 +0000 (12:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 26 Nov 2025 12:11:51 +0000 (13:11 +0100)
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>
drivers/tty/serial/icom.c

index 7fb995a8490e12f81d986699af09bf74c58c39c8..566c05511b0f56c49877866622b57f6a8a08c3e4 100644 (file)
@@ -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;
        }