Skip to contentSkip to conversation

hwmon: (k10temp) remove unnecessary pci_set_drvdata()

PATCH Applied Jingoo Han 3 participants 3 messages Sep 12, 2013

Subsystems (2)
lore
Share & tools
lore

Jingoo Han

author
#0 lore raw

PATCH 1/1 hwmon: (k10temp) 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/hwmon/k10temp.c |    1 -
 1 file changed, 1 deletion(-)
drivers/hwmon/k10temp.c +0 -1
index e633856..d65f3fd 100644
@@ -202,7 +202,6 @@ static void k10temp_remove(struct pci_dev *pdev)
 			   &sensor_dev_attr_temp1_crit.dev_attr);
 	device_remove_file(&pdev->dev,
 			   &sensor_dev_attr_temp1_crit_hyst.dev_attr);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = {
Signature · 8 lines
1.7.10.4



_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
maintainer Acked-by on v1 1/1
#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.

Quoted 9 lines
---
 drivers/hwmon/k10temp.c |    1 -
 1 file changed, 1 deletion(-)
drivers/hwmon/k10temp.c +0 -0
index e633856..d65f3fd 100644

drivers/hwmon/k10temp.c static void k10temp_remove(struct pci_dev *pdev) · line 207

Quoted 7 lines
drivers/hwmon/k10temp.c +0 -1
@@ -202,7 +202,6 @@ static void k10temp_remove(struct pci_dev *pdev)
 			   &sensor_dev_attr_temp1_crit.dev_attr);
 	device_remove_file(&pdev->dev,
 			   &sensor_dev_attr_temp1_crit_hyst.dev_attr);
-	pci_set_drvdata(pdev, NULL);
 }
 
 static DEFINE_PCI_DEVICE_TABLE(k10temp_id_table) = {

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors