public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Javi Merino <javi.merino@arm.com>
To: Zhang Rui <rui.zhang@intel.com>,
	Linux PM list <linux-pm@vger.kernel.org>
Cc: eduardo.valentin@ti.com, wni@nvidia.com,
	Javi Merino <javi.merino@arm.com>
Subject: [PATCH 1/2] thermal: use the default governor if none was specified in the thermal zone parameters
Date: Thu, 27 Feb 2014 13:48:19 +0000	[thread overview]
Message-ID: <1393508900-19931-1-git-send-email-javi.merino@arm.com> (raw)
In-Reply-To: <20140227134122.GA4417@e102654-lin.cambridge.arm.com>

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 --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);
-- 
1.7.9.5



  reply	other threads:[~2014-02-27 13:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-27  6:41 [PATCH] Thermal: thermal zone governor fix Zhang Rui
2014-02-27  6:47 ` Zhang Rui
2014-02-27 13:41   ` Javi Merino
2014-02-27 13:48     ` Javi Merino [this message]
2014-02-27 13:48       ` [PATCH 2/2] " Javi Merino
2014-02-27 14:21     ` [PATCH] " Zhang, Rui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393508900-19931-1-git-send-email-javi.merino@arm.com \
    --to=javi.merino@arm.com \
    --cc=eduardo.valentin@ti.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=wni@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox