rdc_gpio_config() uses pci_{read,write}_config_dword() that return
PCIBIOS_* codes. rdc_gpio_config() is used for
direction_{input,output}() in the struct gpio_chip which both require
normal errnos to be returned.
Similarly, rdc321x_gpio_probe() that is probe function returns
PCIBIOS_* codes without converting them first into normal errnos.
Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal
errno before returning them to fix both issues.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20240527132345.13956-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
unlock:
spin_unlock(&gpch->lock);
- return err;
+ return pcibios_err_to_errno(err);
}
/* configure GPIO pin as input */
rdc321x_gpio_dev->reg1_data_base,
&rdc321x_gpio_dev->data_reg[0]);
if (err)
- return err;
+ return pcibios_err_to_errno(err);
err = pci_read_config_dword(rdc321x_gpio_dev->sb_pdev,
rdc321x_gpio_dev->reg2_data_base,
&rdc321x_gpio_dev->data_reg[1]);
if (err)
- return err;
+ return pcibios_err_to_errno(err);
dev_info(&pdev->dev, "registering %d GPIOs\n",
rdc321x_gpio_dev->chip.ngpio);