From patchwork Fri Nov 28 09:44:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 41688 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 81527244C2 for ; Fri, 28 Nov 2014 09:46:03 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id hs14sf470029lab.1 for ; Fri, 28 Nov 2014 01:46:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=bZJXKHy5II3pjYUFISRD0W2EgLaMDi96AVK4HfvAi/k=; b=ZPXGQ9j19Waz99Y4XGrxjua8QljyAcAtUxAMnLki2t+0lerVQbg4mQCQf4ID8vm47D xmYXAyRjurS5GA04GUtHip3OMw1mVJEpfS8TRYKrzCtBvtlFceboAR+DkwDd3mYuHka/ GRpcny5mK8pxUSFCSlmSn0vDCAVd71CKNWRgCHQkN8A8yQEGwaYOShEjyo0hSTnfQtE5 3GaMaAcfThMvHhIYEnlsQp62eVjgNls8HZHuQQtOKI5PLkzJw1PWIpHkzGIingGSCmgH DZmt6FMLBTgiTrWXVehErDaLLrHtHKQT9PSwn0BLEYb2a/NxCWjTKcQv/+enbd2vuhgM JsWQ== X-Gm-Message-State: ALoCoQkV6qGM9AkJFtUrLWPFtnQVVu7Yo89wiy3ikW9hknwM5YbetqDsD5nmeMQI1e+mzD/SS7Ha X-Received: by 10.181.13.147 with SMTP id ey19mr9742204wid.2.1417167962443; Fri, 28 Nov 2014 01:46:02 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.28.67 with SMTP id z3ls923443lag.74.gmail; Fri, 28 Nov 2014 01:46:02 -0800 (PST) X-Received: by 10.112.202.71 with SMTP id kg7mr24525003lbc.16.1417167962284; Fri, 28 Nov 2014 01:46:02 -0800 (PST) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id la5si9466753lac.64.2014.11.28.01.46.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 28 Nov 2014 01:46:02 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by mail-lb0-f172.google.com with SMTP id u10so5318508lbd.31 for ; Fri, 28 Nov 2014 01:46:02 -0800 (PST) X-Received: by 10.112.38.4 with SMTP id c4mr27285186lbk.46.1417167962200; Fri, 28 Nov 2014 01:46:02 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.184.201 with SMTP id ew9csp60518lbc; Fri, 28 Nov 2014 01:46:01 -0800 (PST) X-Received: by 10.70.137.42 with SMTP id qf10mr71183071pdb.100.1417167960564; Fri, 28 Nov 2014 01:46:00 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id vj10si15336419pbc.138.2014.11.28.01.45.58 for ; Fri, 28 Nov 2014 01:46:00 -0800 (PST) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751423AbaK1Jp6 (ORCPT + 12 others); Fri, 28 Nov 2014 04:45:58 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:38089 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751394AbaK1Jp5 (ORCPT ); Fri, 28 Nov 2014 04:45:57 -0500 Received: by mail-pa0-f44.google.com with SMTP id et14so6599325pad.3 for ; Fri, 28 Nov 2014 01:45:57 -0800 (PST) X-Received: by 10.70.130.73 with SMTP id oc9mr45541909pdb.42.1417167957143; Fri, 28 Nov 2014 01:45:57 -0800 (PST) Received: from localhost ([122.167.111.40]) by mx.google.com with ESMTPSA id y9sm9418961pdj.29.2014.11.28.01.45.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 28 Nov 2014 01:45:56 -0800 (PST) From: Viresh Kumar To: linux-pm@vger.kernel.org, edubezval@gmail.com Cc: linaro-kernel@lists.linaro.org, rui.zhang@intel.com, Viresh Kumar Subject: [PATCH 21/26] cpu_cooling: create list of cpufreq_cooling_devices Date: Fri, 28 Nov 2014 15:14:15 +0530 Message-Id: <451cea6e5f417b0e76747ea8d8f3aa852f8bbf54.1417167599.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.3.693.g996b0fd In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , That will be used by later patches to iterate over all cpufreq cooling devices. Signed-off-by: Viresh Kumar --- drivers/thermal/cpu_cooling.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/thermal/cpu_cooling.c b/drivers/thermal/cpu_cooling.c index ddb97aa..f76a665 100644 --- a/drivers/thermal/cpu_cooling.c +++ b/drivers/thermal/cpu_cooling.c @@ -66,8 +66,11 @@ struct cpufreq_cooling_device { unsigned int cpufreq_val; unsigned int max_level; struct cpumask allowed_cpus; + struct list_head head; }; + static DEFINE_IDR(cpufreq_idr); +static LIST_HEAD(cpufreq_dev_list); static DEFINE_MUTEX(cooling_cpufreq_lock); static unsigned int cpufreq_dev_count; @@ -372,6 +375,7 @@ __cpufreq_cooling_register(struct device_node *np, goto remove_idr; cpufreq_dev->cool_dev = cool_dev; + INIT_LIST_HEAD(&cpufreq_dev->head); mutex_lock(&cooling_cpufreq_lock); @@ -381,6 +385,7 @@ __cpufreq_cooling_register(struct device_node *np, CPUFREQ_POLICY_NOTIFIER); cpufreq_dev_count++; + list_add(&cpufreq_dev->head, &cpufreq_dev_list); mutex_unlock(&cooling_cpufreq_lock); return cool_dev; @@ -451,6 +456,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) cpufreq_dev = cdev->devdata; mutex_lock(&cooling_cpufreq_lock); cpufreq_dev_count--; + list_del(&cpufreq_dev->head); /* Unregister the notifier for the last cpufreq cooling device */ if (cpufreq_dev_count == 0)