Skip to content

Commit 53ea31b

Browse files
andy-shevgregkh
authored andcommitted
serial: 8250_exar: Don't return positive values as error codes
PCI core may return positive codes for the specific errors. There is a special API to convert them to negative stanrard ones. Use that API to avoid returning positive values as error codes. Fixes: f7ce070 ("serial: exar: add CTI specific setup code") Signed-off-by: Andy Shevchenko <[email protected]> Tested-by: Parker Newman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 660a708 commit 53ea31b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/8250/8250_exar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,12 +1162,12 @@ static int cti_board_init_fpga(struct exar8250 *priv, struct pci_dev *pcidev)
11621162
// Enable external interrupts in special cfg space register
11631163
ret = pci_read_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, &cfg_val);
11641164
if (ret)
1165-
return ret;
1165+
return pcibios_err_to_errno(ret);
11661166

11671167
cfg_val |= CTI_FPGA_CFG_INT_EN_EXT_BIT;
11681168
ret = pci_write_config_word(pcidev, CTI_FPGA_CFG_INT_EN_REG, cfg_val);
11691169
if (ret)
1170-
return ret;
1170+
return pcibios_err_to_errno(ret);
11711171

11721172
// RS485 gate needs to be enabled; otherwise RTS/CTS will not work
11731173
exar_write_reg(priv, CTI_FPGA_RS485_IO_REG, 0x01);

0 commit comments

Comments
 (0)