Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240527132345.13956-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

authored by

Ilpo Järvinen and committed by
Bartosz Golaszewski
d4cde6e4 ca09ce25

+3 -1
+3 -1
drivers/gpio/gpio-amd8111.c
··· 195 195 196 196 found: 197 197 err = pci_read_config_dword(pdev, 0x58, &gp.pmbase); 198 - if (err) 198 + if (err) { 199 + err = pcibios_err_to_errno(err); 199 200 goto out; 201 + } 200 202 err = -EIO; 201 203 gp.pmbase &= 0x0000FF00; 202 204 if (gp.pmbase == 0)