From patchwork Fri Oct 18 10:03:06 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Ni X-Patchwork-Id: 3065531 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 086CEBF924 for ; Fri, 18 Oct 2013 10:03:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ECBE9204FB for ; Fri, 18 Oct 2013 10:03:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B7C7B204E2 for ; Fri, 18 Oct 2013 10:03:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752597Ab3JRKDg (ORCPT ); Fri, 18 Oct 2013 06:03:36 -0400 Received: from hqemgate14.nvidia.com ([216.228.121.143]:7986 "EHLO hqemgate14.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752466Ab3JRKDg (ORCPT ); Fri, 18 Oct 2013 06:03:36 -0400 Received: from hqnvupgp08.nvidia.com (Not Verified[216.228.121.13]) by hqemgate14.nvidia.com id ; Fri, 18 Oct 2013 03:03:32 -0700 Received: from hqemhub02.nvidia.com ([172.20.12.94]) by hqnvupgp08.nvidia.com (PGP Universal service); Fri, 18 Oct 2013 02:59:05 -0700 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Fri, 18 Oct 2013 02:59:05 -0700 Received: from hkemhub01.nvidia.com (10.18.67.12) by hqemhub02.nvidia.com (172.20.150.31) with Microsoft SMTP Server (TLS) id 8.3.327.1; Fri, 18 Oct 2013 03:03:35 -0700 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; Fri, 18 Oct 2013 18:03:14 +0800 From: Wei Ni To: , CC: , , , Wei Ni , Jinyoung Park Subject: [PATCH] thermal: Fix binding problem when there is thermal zone params Date: Fri, 18 Oct 2013 18:03:06 +0800 Message-ID: <1382090587-9602-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=-7.3 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 4962a6a..2ea41d3 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -247,7 +247,7 @@ 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); @@ -282,8 +282,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)