Skip to content

Commit 9a73e03

Browse files
ij-intelBartosz Golaszewski
authored andcommitted
gpio: rdc321x: Convert PCIBIOS_* return codes to errnos
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent d4cde6e commit 9a73e03

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpio/gpio-rdc321x.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static int rdc_gpio_config(struct gpio_chip *chip,
102102
unlock:
103103
spin_unlock(&gpch->lock);
104104

105-
return err;
105+
return pcibios_err_to_errno(err);
106106
}
107107

108108
/* configure GPIO pin as input */
@@ -170,13 +170,13 @@ static int rdc321x_gpio_probe(struct platform_device *pdev)
170170
rdc321x_gpio_dev->reg1_data_base,
171171
&rdc321x_gpio_dev->data_reg[0]);
172172
if (err)
173-
return err;
173+
return pcibios_err_to_errno(err);
174174

175175
err = pci_read_config_dword(rdc321x_gpio_dev->sb_pdev,
176176
rdc321x_gpio_dev->reg2_data_base,
177177
&rdc321x_gpio_dev->data_reg[1]);
178178
if (err)
179-
return err;
179+
return pcibios_err_to_errno(err);
180180

181181
dev_info(&pdev->dev, "registering %d GPIOs\n",
182182
rdc321x_gpio_dev->chip.ngpio);

0 commit comments

Comments
 (0)