Skip to contentSkip to conversation

x86/PCI: VMD: Remove unnecessary pci_set_drvdata()

PATCH In review Wei Yongjun 3 participants 3 messages Oct 17, 2016 – Nov 11, 2016 PCI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/PCI: VMD: Remove unnecessary pci_set_drvdata()

From: Wei Yongjun <[email protected]>

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/pci/host/vmd.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/host/vmd.c +0 -1
index 37e29b5..6614b3552 100644
@@ -719,7 +719,6 @@ static void vmd_remove(struct pci_dev *dev)
 	struct vmd_dev *vmd = pci_get_drvdata(dev);
 
 	vmd_detach_resources(vmd);
-	pci_set_drvdata(dev, NULL);
 	sysfs_remove_link(&vmd->dev->dev.kobj, "domain");
 	pci_stop_root_bus(vmd->bus);
 	pci_remove_root_bus(vmd->bus);
#2 lore raw
In reply to Wei Yongjun
Quoted 7 lines · Wei Yongjun

From: Wei Yongjun <[email protected]>

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 with Keith's reviewed-by to pci/host-vmd for v4.10, thanks!

Quoted 23 lines
---
 drivers/pci/host/vmd.c | 1 -
 1 file changed, 1 deletion(-)
drivers/pci/host/vmd.c +0 -2
index 37e29b5..6614b3552 100644
@@ -719,7 +719,6 @@ static void vmd_remove(struct pci_dev *dev)
 	struct vmd_dev *vmd = pci_get_drvdata(dev);
 
 	vmd_detach_resources(vmd);
-	pci_set_drvdata(dev, NULL);
 	sysfs_remove_link(&vmd->dev->dev.kobj, "domain");
 	pci_stop_root_bus(vmd->bus);
 	pci_remove_root_bus(vmd->bus);
 
 
 
--

To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html