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: 1490071 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C2E14DF28C for ; Fri, 21 Sep 2012 07:03:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751541Ab2IUHDx (ORCPT ); Fri, 21 Sep 2012 03:03:53 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:59574 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751034Ab2IUHDw (ORCPT ); Fri, 21 Sep 2012 03:03:52 -0400 Received: by pbbrr4 with SMTP id rr4so1982020pbb.19 for ; Fri, 21 Sep 2012 00:03:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=BcS4BheXEaM6vt/mz2hBenZEKbxvDQ4etvpJsG7m8Ds=; b=GJ7o0RH26Qqe1pFFskC2tMSnGE6H2KCJ2zLRlauaCmGU3L+HtcvW1Q4kc0GgiEH/i1 pAkiTOSM9om61+vocyCKYroDZzYQaGp4Ryi20bkhRhY7Uo6LCN/1Hde2zLk0NiA59Jzn krh2X23iXZYjmBiTuMY8oOyLmO/3anArPzFLIwhRzH54Dte1w6HLdNQEUDG5TnKU11rT V7gE6TBcj7QdLaHVfavzge+17xN+RL7K+UtU8lNzDHJEHNHYkhAoHnmW47KOywGqfr6D zryj8zWS108SIJJWsROWgejtxDwHRhkvuCwbkxU7Y8lNc7jzSFuQmFjO/rmyaRRKg/vY H0xg== 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: ALoCoQl1bm3MV7KNOYMftu0JBappz0M0mJU6rPcTA6yy8t3UNohZWrNPb0Kh+Os0Y5ukVBRWpwej Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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;