Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fcba212d authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

spi: clps711x: Provide label argument for devm_gpio_request



The label argument was removed by commit 98984796
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: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent bf5c2e27
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -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;
		}
	}