Skip to contentSkip to conversation

Input: serio: remove unnecessary pci_set_drvdata()

PATCH Applied Jingoo Han 2 participants 2 messages Nov 25, 2013 – Nov 26, 2013

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 Input: serio: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

---
 drivers/input/serio/pcips2.c |    1 -
 1 file changed, 1 deletion(-)
drivers/input/serio/pcips2.c +0 -1
index 76f8383..13062f6 100644
@@ -181,7 +181,6 @@ static void pcips2_remove(struct pci_dev *dev)
 	struct pcips2_data *ps2if = pci_get_drvdata(dev);
 
 	serio_unregister_port(ps2if->io);
-	pci_set_drvdata(dev, NULL);
 	kfree(ps2if);
 	pci_release_regions(dev);
 	pci_disable_device(dev);
Signature · 1 line
1.7.10.4
maintainer Applied
#1 lore raw
Quoted 5 lines · Jingoo Han

The driver core clears the driver data to NULL after device_release or on probe failure. Thus, it is not needed to manually clear the device driver data to NULL.

Applied, thank you.

Quoted 20 lines
---
 drivers/input/serio/pcips2.c |    1 -
 1 file changed, 1 deletion(-)
drivers/input/serio/pcips2.c +0 -1
index 76f8383..13062f6 100644
@@ -181,7 +181,6 @@ static void pcips2_remove(struct pci_dev *dev)
 	struct pcips2_data *ps2if = pci_get_drvdata(dev);
 
 	serio_unregister_port(ps2if->io);
-	pci_set_drvdata(dev, NULL);
 	kfree(ps2if);
 	pci_release_regions(dev);
 	pci_disable_device(dev);
Signature · 1 line
1.7.10.4
Signature · 1 line
Dmitry