Skip to contentSkip to conversation

thermal: intel_pch: Drop explicit pci_set_drvdata(NULL) in remove

PATCH Applied Kaushlendra Kumar 2 participants 2 messages Dec 15, 2025 – Jan 7 Thermal

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal: intel_pch: Drop explicit pci_set_drvdata(NULL) in remove

The driver uses devm_kzalloc() for device allocation, making the pci_set_drvdata(pdev, NULL) call in the remove path unnecessary. The driver core clears drvdata automatically during device removal.

---
 drivers/thermal/intel/intel_pch_thermal.c | 1 -
 1 file changed, 1 deletion(-)
drivers/thermal/intel/intel_pch_thermal.c +0 -1
index fc326985796c..52e71af67dc6 100644
@@ -269,7 +269,6 @@ static void intel_pch_thermal_remove(struct pci_dev *pdev)
 
 	thermal_zone_device_unregister(ptd->tzd);
 	iounmap(ptd->hw_base);
-	pci_set_drvdata(pdev, NULL);
 	pci_release_regions(pdev);
 	pci_disable_device(pdev);
 }
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 15 lines · Kaushlendra Kumar

The driver uses devm_kzalloc() for device allocation, making the pci_set_drvdata(pdev, NULL) call in the remove path unnecessary. The driver core clears drvdata automatically during device removal.

---
 drivers/thermal/intel/intel_pch_thermal.c | 1 -
 1 file changed, 1 deletion(-)
drivers/thermal/intel/intel_pch_thermal.c +0 -0
index fc326985796c..52e71af67dc6 100644

drivers/thermal/intel/intel_pch_thermal.c static void intel_pch_thermal_remove(struct pci_dev *pdev)

Quoted 8 lines
drivers/thermal/intel/intel_pch_thermal.c +0 -2
@@ -269,7 +269,6 @@ static void intel_pch_thermal_remove(struct pci_dev *pdev)
 
        thermal_zone_device_unregister(ptd->tzd);
        iounmap(ptd->hw_base);
-       pci_set_drvdata(pdev, NULL);
        pci_release_regions(pdev);
        pci_disable_device(pdev);
 }
--

Applied as 6.20 material, thanks!