Commit d4cde6e4 authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Bartosz Golaszewski

gpio: amd8111: Convert PCIBIOS_* return codes to errnos

amd_gpio_init() uses pci_read_config_dword() that returns PCIBIOS_*
codes. The return code is then returned as is but amd_gpio_init() is
a module init function that should return normal errnos.

Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal
errno before returning it from amd_gpio_init().
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240527132345.13956-1-ilpo.jarvinen@linux.intel.comSigned-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent ca09ce25
......@@ -195,8 +195,10 @@ static int __init amd_gpio_init(void)
found:
err = pci_read_config_dword(pdev, 0x58, &gp.pmbase);
if (err)
if (err) {
err = pcibios_err_to_errno(err);
goto out;
}
err = -EIO;
gp.pmbase &= 0x0000FF00;
if (gp.pmbase == 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment