mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
Revert "thermal/core: Use the thermal class pointer as init guard"
This reverts commit 499274d078 ("thermal/core: Use the thermal class
pointer as init guard") because it depends on another commit that needs
to be reverted.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://patch.msgid.link/6301222.lOV4Wx5bFT@rafael.j.wysocki
This commit is contained in:
parent
876bd34e24
commit
1087c29d9c
|
|
@ -890,6 +890,7 @@ static void thermal_unbind_cdev_from_trip(struct thermal_zone_device *tz,
|
|||
}
|
||||
|
||||
static struct class *thermal_class __ro_after_init;
|
||||
static bool thermal_class_unavailable __ro_after_init = true;
|
||||
|
||||
static inline
|
||||
void print_bind_err_msg(struct thermal_zone_device *tz,
|
||||
|
|
@ -973,7 +974,7 @@ thermal_cooling_device_alloc(const char *type, const struct thermal_cooling_devi
|
|||
!ops->set_cur_state)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (!thermal_class)
|
||||
if (thermal_class_unavailable)
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
cdev = kzalloc_obj(*cdev);
|
||||
|
|
@ -1447,7 +1448,7 @@ thermal_zone_device_register_with_trips(const char *type,
|
|||
if (polling_delay && passive_delay > polling_delay)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (!thermal_class)
|
||||
if (thermal_class_unavailable)
|
||||
return ERR_PTR(-ENODEV);
|
||||
|
||||
tz = kzalloc_flex(*tz, trips, num_trips);
|
||||
|
|
@ -1745,7 +1746,7 @@ static void __thermal_pm_prepare(void)
|
|||
|
||||
void thermal_pm_prepare(void)
|
||||
{
|
||||
if (!thermal_class)
|
||||
if (thermal_class_unavailable)
|
||||
return;
|
||||
|
||||
__thermal_pm_prepare();
|
||||
|
|
@ -1776,7 +1777,7 @@ void thermal_pm_complete(void)
|
|||
{
|
||||
struct thermal_zone_device *tz;
|
||||
|
||||
if (!thermal_class)
|
||||
if (thermal_class_unavailable)
|
||||
return;
|
||||
|
||||
guard(mutex)(&thermal_list_lock);
|
||||
|
|
@ -1815,6 +1816,8 @@ static int __init thermal_init(void)
|
|||
}
|
||||
|
||||
thermal_class = tc;
|
||||
thermal_class_unavailable = false;
|
||||
|
||||
return 0;
|
||||
|
||||
unregister_governors:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user