Skip to contentSkip to conversation

gpio-lynxpoint: remove unnecessary platform_set_drvdata()

PATCH In review Andy Shevchenko 3 participants 3 messages May 22, 2013 – May 30, 2013 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio-lynxpoint: remove unnecessary platform_set_drvdata()

Since 0998d06310 "device-core: Ensure drvdata = NULL when no driver is bound", this is done by driver core after device_release or on probe failure. Thus we can remove all platform_set_drvdata(pdev, NULL) in drivers.

---
 drivers/gpio/gpio-lynxpoint.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-lynxpoint.c +1 -1
index 86c17de..588991d 100644
@@ -444,10 +444,10 @@ static int lp_gpio_remove(struct platform_device *pdev)
 {
 	struct lp_gpio *lg = platform_get_drvdata(pdev);
 	int err;
+
 	err = gpiochip_remove(&lg->chip);
 	if (err)
 		dev_warn(&pdev->dev, "failed to remove gpio_chip.\n");
-	platform_set_drvdata(pdev, NULL);
 	return 0;
 }
 
Signature · 1 line
1.8.2.rc0.22.gb3600c3
#2 lore raw
In reply to Andy Shevchenko
Quoted 5 lines · Andy Shevchenko

Since 0998d06310 "device-core: Ensure drvdata = NULL when no driver is bound", this is done by driver core after device_release or on probe failure. Thus we can remove all platform_set_drvdata(pdev, NULL) in drivers.

I already had a patch from Jingoo Han for this in my patch queue, so dropped this patch.

Yours,
Linus Walleij