Skip to content

Commit 7821fa1

Browse files
ij-intelbp3tk0v
authored andcommitted
x86/platform/iosf_mbi: Convert PCIBIOS_* return codes to errnos
iosf_mbi_pci_{read,write}_mdr() use pci_{read,write}_config_dword() that return PCIBIOS_* codes but functions also return -ENODEV which are not compatible error codes. As neither of the functions are related to PCI read/write functions, they should return normal errnos. Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it. Fixes: 4618441 ("arch: x86: New MailBox support driver for Intel SOC's") Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e9d7b43 commit 7821fa1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/platform/intel/iosf_mbi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int iosf_mbi_pci_read_mdr(u32 mcrx, u32 mcr, u32 *mdr)
6262

6363
fail_read:
6464
dev_err(&mbi_pdev->dev, "PCI config access failed with %d\n", result);
65-
return result;
65+
return pcibios_err_to_errno(result);
6666
}
6767

6868
static int iosf_mbi_pci_write_mdr(u32 mcrx, u32 mcr, u32 mdr)
@@ -91,7 +91,7 @@ static int iosf_mbi_pci_write_mdr(u32 mcrx, u32 mcr, u32 mdr)
9191

9292
fail_write:
9393
dev_err(&mbi_pdev->dev, "PCI config access failed with %d\n", result);
94-
return result;
94+
return pcibios_err_to_errno(result);
9595
}
9696

9797
int iosf_mbi_read(u8 port, u8 opcode, u32 offset, u32 *mdr)

0 commit comments

Comments
 (0)