2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-16 17:23:55 +08:00

spi: clps711x: Provide label argument for devm_gpio_request

The label argument was removed by commit 989847967c
spi: clps711x: Use devm_gpio_request(), add it back.
This makes it easier to know the gpio usage in /sys/kernel/debug/gpio.

Also remove unnecessary gpio_is_valid() checking, devm_gpio_request() returns
error if the requested gpio is invalid.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Axel Lin 2014-03-04 12:59:53 +08:00 committed by Mark Brown
parent bf5c2e2703
commit fcba212de9

View File

@ -159,14 +159,10 @@ static int spi_clps711x_probe(struct platform_device *pdev)
for (i = 0; i < master->num_chipselect; i++) { for (i = 0; i < master->num_chipselect; i++) {
master->cs_gpios[i] = pdata->chipselect[i]; master->cs_gpios[i] = pdata->chipselect[i];
if (!gpio_is_valid(master->cs_gpios[i])) { ret = devm_gpio_request(&pdev->dev, master->cs_gpios[i],
dev_err(&pdev->dev, "Invalid CS GPIO %i\n", i); DRIVER_NAME);
ret = -EINVAL; if (ret) {
goto err_out;
}
if (devm_gpio_request(&pdev->dev, master->cs_gpios[i], NULL)) {
dev_err(&pdev->dev, "Can't get CS GPIO %i\n", i); dev_err(&pdev->dev, "Can't get CS GPIO %i\n", i);
ret = -EINVAL;
goto err_out; goto err_out;
} }
} }