Skip to contentSkip to conversation

gpio: arizona: Remove pointless set of platform drvdata

PATCH In review Charles Keepax 2 participants 4 messages Nov 25, 2016 – Nov 30, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 gpio: arizona: Remove pointless set of platform drvdata

We use the gpio chip private data in all the callbacks so remove this redundant line of code.

---
 drivers/gpio/gpio-arizona.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpio/gpio-arizona.c +0 -2
index 4824628..ed41537 100644
@@ -140,8 +140,6 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 		goto err;
 	}
 
-	platform_set_drvdata(pdev, arizona_gpio);
-
 	return ret;
 
 err:
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 gpio: arizona: Tidy up probe error path

There is some unnecessary complexity in the error path which now things are converted to devm is actually very simple. This patch simplifies things.

---
 drivers/gpio/gpio-arizona.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/gpio/gpio-arizona.c +2 -5
index ed41537..1f91557 100644
@@ -137,13 +137,10 @@ static int arizona_gpio_probe(struct platform_device *pdev)
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Could not register gpiochip, %d\n",
 			ret);
-		goto err;
+		return ret;
 	}
 
-	return ret;
-
-err:
-	return ret;
+	return 0;
 }
 
 static struct platform_driver arizona_gpio_driver = {
Signature · 1 line
2.1.4