@@ -89,7 +89,7 @@ int thermal_register_governor(struct thermal_governor *governor)
list_for_each_entry(pos, &thermal_tz_list, node) {
if (pos->governor)
continue;
- if (pos->tzp)
+ if ((pos->tzp) && (pos->tzp->governor_name[0]))
name = pos->tzp->governor_name;
else
name = DEFAULT_THERMAL_GOVERNOR;
@@ -1530,7 +1530,7 @@ struct thermal_zone_device *thermal_zone_device_register(const char *type,
/* Update 'this' zone's governor information */
mutex_lock(&thermal_governor_lock);
- if (tz->tzp)
+ if ((tz->tzp) && (tz->tzp->governor_name[0]))
tz->governor = __find_governor(tz->tzp->governor_name);
else
tz->governor = __find_governor(DEFAULT_THERMAL_GOVERNOR);
If you pass a thermal_zone_params to thermal_zone_device_register() without specifying the governor_name, use the default one. Currently of_parse_thermal_zones() is the only user of thermal_zone_params, but potentially other users of this function could do the same. Signed-off-by: Javi Merino <javi.merino@arm.com> --- drivers/thermal/thermal_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)