From patchwork Thu Feb 27 13:48:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 3733191 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8A3439F2F7 for ; Thu, 27 Feb 2014 13:48:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BE7E42021A for ; Thu, 27 Feb 2014 13:48:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2078201FE for ; Thu, 27 Feb 2014 13:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751454AbaB0Nsx (ORCPT ); Thu, 27 Feb 2014 08:48:53 -0500 Received: from service87.mimecast.com ([91.220.42.44]:57387 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbaB0Nsw (ORCPT ); Thu, 27 Feb 2014 08:48:52 -0500 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 27 Feb 2014 13:48:50 +0000 Received: from e102654-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 27 Feb 2014 13:48:48 +0000 Received: by e102654-lin.cambridge.arm.com (sSMTP sendmail emulation); Thu, 27 Feb 2014 13:48:48 +0000 From: Javi Merino To: Zhang Rui , Linux PM list Cc: eduardo.valentin@ti.com, wni@nvidia.com, Javi Merino 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 Message-Id: <1393508900-19931-1-git-send-email-javi.merino@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <20140227134122.GA4417@e102654-lin.cambridge.arm.com> References: <20140227134122.GA4417@e102654-lin.cambridge.arm.com> X-OriginalArrivalTime: 27 Feb 2014 13:48:48.0706 (UTC) FILETIME=[A41CDA20:01CF33C2] X-MC-Unique: 114022713485007901 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);