diff mbox series

[RFC,for,6.13,v1,18/20] thermal: core: Call __thermal_cdev_update() on cdev unbind

Message ID 2227092.Icojqenx9y@rjwysocki.net (mailing list archive)
State RFC, archived
Headers show
Series thermal: core: Updates related to thermal zone initialization, suspend and locking | expand

Commit Message

Rafael J. Wysocki Sept. 14, 2024, 10:48 a.m. UTC
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

When deleting a thermal instance from a cooling device's list of thermal
instances, update it in case its state has been determined by the thermal
instance going away.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/thermal/thermal_core.c |    6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

Index: linux-pm/drivers/thermal/thermal_core.c
===================================================================
--- linux-pm.orig/drivers/thermal/thermal_core.c
+++ linux-pm/drivers/thermal/thermal_core.c
@@ -864,6 +864,12 @@  static void thermal_instance_delete(stru
 	guard(cooling_dev)(instance->cdev);
 
 	list_del(&instance->cdev_node);
+
+	/*
+	 * Update the cdev in case its state has been determined by the thermal
+	 * instance going away.
+	 */
+	__thermal_cdev_update(instance->cdev);
 }
 
 /**