diff mbox

spi: clps711x: Provide label argument for devm_gpio_request

Message ID 1393909193.18753.1.camel@phoenix (mailing list archive)
State Accepted
Commit fcba212de9bdf1016d981c355df29ab169da8eae
Delegated to: Mark Brown
Headers show

Commit Message

Axel Lin March 4, 2014, 4:59 a.m. UTC
The label argument was removed by commit 989847967cd762
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>
---
 drivers/spi/spi-clps711x.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Mark Brown March 10, 2014, 11:24 a.m. UTC | #1
On Tue, Mar 04, 2014 at 12:59:53PM +0800, Axel Lin wrote:
> The label argument was removed by commit 989847967cd762
> spi: clps711x: Use devm_gpio_request(), add it back.
> This makes it easier to know the gpio usage in /sys/kernel/debug/gpio.

Applied, thanks.
diff mbox

Patch

diff --git a/drivers/spi/spi-clps711x.c b/drivers/spi/spi-clps711x.c
index 3900c31..2b60935 100644
--- a/drivers/spi/spi-clps711x.c
+++ b/drivers/spi/spi-clps711x.c
@@ -158,14 +158,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;
 		}
 	}