Skip to content

Commit

Permalink
spi: clps711x: Provide label argument for devm_gpio_request
Browse files Browse the repository at this point in the history
The label argument was removed by commit 9898479
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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Mar 10, 2014
1 parent bf5c2e2 commit fcba212
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/spi/spi-clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,14 +159,10 @@ static int spi_clps711x_probe(struct platform_device *pdev)

for (i = 0; i < master->num_chipselect; i++) {
master->cs_gpios[i] = pdata->chipselect[i];
if (!gpio_is_valid(master->cs_gpios[i])) {
dev_err(&pdev->dev, "Invalid CS GPIO %i\n", i);
ret = -EINVAL;
goto err_out;
}
if (devm_gpio_request(&pdev->dev, master->cs_gpios[i], NULL)) {
ret = devm_gpio_request(&pdev->dev, master->cs_gpios[i],
DRIVER_NAME);
if (ret) {
dev_err(&pdev->dev, "Can't get CS GPIO %i\n", i);
ret = -EINVAL;
goto err_out;
}
}
Expand Down

0 comments on commit fcba212

Please sign in to comment.