diff mbox

[1/2] thermal: use the default governor if none was specified in the thermal zone parameters

Message ID 1393508900-19931-1-git-send-email-javi.merino@arm.com (mailing list archive)
State Rejected
Delegated to: Zhang Rui
Headers show

Commit Message

Javi Merino Feb. 27, 2014, 1:48 p.m. UTC
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(-)
diff mbox

Patch

diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 338a88b..9b655b0 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -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);