===================================================================
@@ -1563,10 +1563,11 @@ struct device *thermal_zone_device(struc
}
EXPORT_SYMBOL_GPL(thermal_zone_device);
-static void thermal_zone_del_from_list(struct thermal_zone_device *tz)
+static void thermal_zone_exit(struct thermal_zone_device *tz)
{
guard(thermal_zone)(tz);
+ tz->state |= TZ_STATE_FLAG_EXIT;
list_del(&tz->node);
}
@@ -1594,7 +1595,7 @@ void thermal_zone_device_unregister(stru
return;
}
- thermal_zone_del_from_list(tz);
+ thermal_zone_exit(tz);
/* Unbind all cdevs associated with 'this' thermal zone */
list_for_each_entry(cdev, &thermal_cdev_list, node)
===================================================================
@@ -65,6 +65,7 @@ struct thermal_governor {
#define TZ_STATE_FLAG_SUSPENDED BIT(0)
#define TZ_STATE_FLAG_RESUMING BIT(1)
#define TZ_STATE_FLAG_INIT BIT(2)
+#define TZ_STATE_FLAG_EXIT BIT(3)
#define TZ_STATE_READY 0