Skip to content

Commit f8367a7

Browse files
ij-intelbp3tk0v
authored andcommitted
EDAC/igen6: Convert PCIBIOS_* return codes to errnos
errcmd_enable_error_reporting() uses pci_{read,write}_config_word() that return PCIBIOS_* codes. The return code is then returned all the way into the probe function igen6_probe() that returns it as is. The probe functions, however, should return normal errnos. Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it from errcmd_enable_error_reporting(). Fixes: 10590a9 ("EDAC/igen6: Add EDAC driver for Intel client SoCs using IBECC") Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Qiuxu Zhuo <[email protected]> Cc: [email protected] Link: https://lore.kernel.org/r/[email protected]
1 parent 3ec8ebd commit f8367a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/edac/igen6_edac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ static int errcmd_enable_error_reporting(bool enable)
800800

801801
rc = pci_read_config_word(imc->pdev, ERRCMD_OFFSET, &errcmd);
802802
if (rc)
803-
return rc;
803+
return pcibios_err_to_errno(rc);
804804

805805
if (enable)
806806
errcmd |= ERRCMD_CE | ERRSTS_UE;
@@ -809,7 +809,7 @@ static int errcmd_enable_error_reporting(bool enable)
809809

810810
rc = pci_write_config_word(imc->pdev, ERRCMD_OFFSET, errcmd);
811811
if (rc)
812-
return rc;
812+
return pcibios_err_to_errno(rc);
813813

814814
return 0;
815815
}

0 commit comments

Comments
 (0)