From patchwork Fri Sep 21 06:57:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongbo Zhang X-Patchwork-Id: 11622 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 890BC19D196 for ; Fri, 21 Sep 2012 06:58:10 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 3EE49A18B21 for ; Fri, 21 Sep 2012 06:58:10 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so4198293iej.11 for ; Thu, 20 Sep 2012 23:58:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=BcS4BheXEaM6vt/mz2hBenZEKbxvDQ4etvpJsG7m8Ds=; b=n0hnTvODMqIHOeX1wzkSP/JP92HNTaaSBLFuGiv7CoxYTSViPkj4XsVCyytU8WaDn8 8/qiAZ2gKTiP/RSAotKP4xDeynFystN/RcgbG6KMckpBuXBF+giQ8Y8zLqMlhWuZ74wU b+EGX1NPhFGyjmZ6/QdJTBumrYL17QIH1e1dLXJ0SgADjsJouTeIJ+KwwkZZ5JjQ2EAg F4rYQoADD5No1hUxm4DpJP2MPXAIFJuMEMyfDbb5L5BbAeDiZg93pjSCmUtCKkyzucxi BJPA4OINy1xwaDrchBA3TmCNG0IYVLtgXVf3DwXMDTNELPqptK+i8/NJiR04zg2y6uvV eJrg== Received: by 10.42.84.69 with SMTP id k5mr3300610icl.5.1348210690052; Thu, 20 Sep 2012 23:58:10 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.184.232 with SMTP id ex8csp114875igc; Thu, 20 Sep 2012 23:58:09 -0700 (PDT) Received: by 10.68.224.162 with SMTP id rd2mr13028381pbc.118.1348210689493; Thu, 20 Sep 2012 23:58:09 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id si9si10569455pbc.302.2012.09.20.23.58.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 23:58:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of hongbo.zhang@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of hongbo.zhang@linaro.org) smtp.mail=hongbo.zhang@linaro.org Received: by mail-pb0-f50.google.com with SMTP id md12so7386004pbc.37 for ; Thu, 20 Sep 2012 23:58:09 -0700 (PDT) Received: by 10.66.74.100 with SMTP id s4mr11041011pav.27.1348210689260; Thu, 20 Sep 2012 23:58:09 -0700 (PDT) Received: from stebjsxu0064.bjs.st.com ([117.136.0.224]) by mx.google.com with ESMTPS id c5sm3687340pay.5.2012.09.20.23.58.00 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 23:58:08 -0700 (PDT) From: zhanghongbo To: linux-pm@vger.kernel.org, len.brown@intel.com, rui.zhang@intel.com Cc: patches@linaro.org, linaro-dev@lists.linaro.org, "hongbo.zhang" Subject: [PATCH 2/2] Thermal: Deactive cooling device when unbind it. Date: Fri, 21 Sep 2012 14:57:18 +0800 Message-Id: <1348210638-4746-3-git-send-email-hongbo.zhang@linaro.org> X-Mailer: git-send-email 1.7.11.3 In-Reply-To: <1348210638-4746-1-git-send-email-hongbo.zhang@linaro.org> References: <1348210638-4746-1-git-send-email-hongbo.zhang@linaro.org> X-Gm-Message-State: ALoCoQmDrWePOd+ZcqQgL2VeRE0m3DoA5Cxr+JCBPmCJ+dV/dgdGYcrFWfFYfDZsd+BKcs/J3PJL From: "hongbo.zhang" A cooling device should be set to state zero when it is unbound. Signed-off-by: hongbo.zhang --- drivers/thermal/thermal_sys.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c index 2c28c85..efc5c56 100644 --- a/drivers/thermal/thermal_sys.c +++ b/drivers/thermal/thermal_sys.c @@ -885,6 +885,8 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *tz, mutex_lock(&tz->lock); list_for_each_entry_safe(pos, next, &tz->cooling_devices, node) { if (pos->tz == tz && pos->trip == trip && pos->cdev == cdev) { + if (cdev->ops->set_cur_state) + cdev->ops->set_cur_state(cdev, 0); list_del(&pos->node); mutex_unlock(&tz->lock); goto unbind;