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(+)
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);
}
/**