From patchwork Wed Nov 6 06:30:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Ni X-Patchwork-Id: 3145021 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5ECE5BEEB2 for ; Wed, 6 Nov 2013 06:30:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46F2A2055D for ; Wed, 6 Nov 2013 06:30:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3DA622054E for ; Wed, 6 Nov 2013 06:30:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750810Ab3KFGag (ORCPT ); Wed, 6 Nov 2013 01:30:36 -0500 Received: from hqemgate15.nvidia.com ([216.228.121.64]:2977 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751135Ab3KFGaf (ORCPT ); Wed, 6 Nov 2013 01:30:35 -0500 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com id ; Tue, 05 Nov 2013 22:29:53 -0800 Received: from hqemhub03.nvidia.com ([172.20.12.94]) by hqnvupgp07.nvidia.com (PGP Universal service); Tue, 05 Nov 2013 22:29:33 -0800 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Tue, 05 Nov 2013 22:29:33 -0800 Received: from HQMAIL108.nvidia.com (172.18.146.13) by hqemhub03.nvidia.com (172.20.150.15) with Microsoft SMTP Server (TLS) id 8.3.327.1; Tue, 5 Nov 2013 22:30:35 -0800 Received: from HQMAIL108.nvidia.com (172.18.146.13) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.712.24; Tue, 5 Nov 2013 22:30:34 -0800 Received: from hkemhub01.nvidia.com (10.18.67.12) by HQMAIL108.nvidia.com (172.18.146.13) with Microsoft SMTP Server (TLS) id 15.0.712.24 via Frontend Transport; Tue, 5 Nov 2013 22:30:34 -0800 Received: from niwei-MCP7A.nvidia.com (10.18.67.5) by hkemhub01.nvidia.com (10.18.67.12) with Microsoft SMTP Server id 8.3.327.1; Wed, 6 Nov 2013 14:30:28 +0800 From: Wei Ni To: CC: , , , , Wei Ni , Jinyoung Park Subject: [PATCH v2] thermal: Fix binding problem when there is thermal zone params Date: Wed, 6 Nov 2013 14:30:13 +0800 Message-ID: <1383719413-4142-1-git-send-email-wni@nvidia.com> X-Mailer: git-send-email 1.7.9.5 X-NVConfidentiality: public MIME-Version: 1.0 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 The thermal zone params can be used to set governor to specific thermal governor for thermal zone device. But if the thermal zone params has only governor name without thermal bind params, then the thermal zone device will not be binding to cooling device. Because tz->ops->bind operator is not invoked in bind_tz() and bind_cdev() when there is thermal zone params. Signed-off-by: Wei Ni Signed-off-by: Jinyoung Park --- drivers/thermal/thermal_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 4962a6a..aa59567 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -247,10 +247,11 @@ static void bind_cdev(struct thermal_cooling_device *cdev) if (!pos->tzp && !pos->ops->bind) continue; - if (!pos->tzp && pos->ops->bind) { + if (pos->ops->bind) { ret = pos->ops->bind(pos, cdev); if (ret) print_bind_err_msg(pos, cdev, ret); + continue; } tzp = pos->tzp; @@ -282,8 +283,8 @@ static void bind_tz(struct thermal_zone_device *tz) mutex_lock(&thermal_list_lock); - /* If there is no platform data, try to use ops->bind */ - if (!tzp && tz->ops->bind) { + /* If there is ops->bind, try to use ops->bind */ + if (tz->ops->bind) { list_for_each_entry(pos, &thermal_cdev_list, node) { ret = tz->ops->bind(tz, pos); if (ret)