Skip to content

Commit d4cde6e

Browse files
ij-intelBartosz Golaszewski
authored andcommitted
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: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent ca09ce2 commit d4cde6e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/gpio/gpio-amd8111.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,10 @@ static int __init amd_gpio_init(void)
195195

196196
found:
197197
err = pci_read_config_dword(pdev, 0x58, &gp.pmbase);
198-
if (err)
198+
if (err) {
199+
err = pcibios_err_to_errno(err);
199200
goto out;
201+
}
200202
err = -EIO;
201203
gp.pmbase &= 0x0000FF00;
202204
if (gp.pmbase == 0)

0 commit comments

Comments
 (0)