Skip to contentSkip to conversation

gpio: tc3589x: remove unnecessary platform_set_drvdata()

PATCH In review Jingoo Han 3 participants 3 messages May 6, 2013 – May 30, 2013 GPIO

lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 5/7 gpio: tc3589x: remove unnecessary platform_set_drvdata()

The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/gpio/gpio-tc3589x.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/gpio/gpio-tc3589x.c +0 -1
index d34d80d..4a5de27 100644
@@ -407,7 +407,6 @@ static int tc3589x_gpio_remove(struct platform_device *pdev)
 
 	free_irq(irq, tc3589x_gpio);
 
-	platform_set_drvdata(pdev, NULL);
 	kfree(tc3589x_gpio);
 
 	return 0;
Signature · 1 line
1.7.2.5
Acked-by on v1 5/7
#1 lore raw
Quoted 15 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/gpio/gpio-tc3589x.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/gpio/gpio-tc3589x.c +0 -0
index d34d80d..4a5de27 100644

drivers/gpio/gpio-tc3589x.c static int tc3589x_gpio_remove(struct platform_device *pdev) · line 412

Quoted 7 lines
drivers/gpio/gpio-tc3589x.c +0 -1
@@ -407,7 +407,6 @@ static int tc3589x_gpio_remove(struct platform_device *pdev)
 
 	free_irq(irq, tc3589x_gpio);
 
-	platform_set_drvdata(pdev, NULL);
 	kfree(tc3589x_gpio);
 
 	return 0;
Signature · 4 lines
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw
In reply to Jingoo Han
Quoted 6 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure, since commit 0998d0631001288a5974afc0b2a5f568bcdecb4d (device-core: Ensure drvdata = NULL when no driver is bound). Thus, it is not needed to manually clear the device driver data to NULL.

Patch applied with Lee's ACK.

Yours,
Linus Walleij