Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3221044imu; Mon, 28 Jan 2019 00:36:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN6pXUJB6H7sJGZdWk78kdS7+vVNCDEPgRWCEjroJdBvYsjl+k3Ez1pxM60me5E1WyBhV5Nh X-Received: by 2002:a17:902:47aa:: with SMTP id r39mr20727305pld.219.1548664590409; Mon, 28 Jan 2019 00:36:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548664590; cv=none; d=google.com; s=arc-20160816; b=vbHTrTd+cT2OSJk175RviYPnh+ezp5GiNfJE6JmGBNLEAJhF6yoXCun9Z+Nn7omOyv 3N7GsKxlOdxjm15rNWYgxVEsSa0XbsR1ONw/DMZ8/+d5Ejuy7pi8janXW+rkfb1gmVW+ ykU7Aumn+IyYcJPZinSU91zhxOE1d666w/MU1mT6h336yNEyQtScFb3MhdXPeY9wrhnY 9tE0BwdBuC43CDQgrwhRAUu8FECWI5Jvb1UO9F7ZtPCw8LdxVgo453t8wGrc1I61itdK JEGUHrAJwP7qULgQjOSwByjdpYRq6ySetf64/Eq4SL2cyIIo7nI/1n/9IxXqmdlU/mol dSdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=VkSTnXqzrCMNWST7wMAGuLPTbplmbXYm19BSa7E5KSQ=; b=pwXxvEoLzbfOVW5DlI9GXbyB2xuMeUXgqfgBkcrEGKcBbyLFeRMhSn9EuEzpeZ1TLJ +V2k+4AQFmEpQenkJVk5+iCP13C7Hbeo+zsIqFq1DWrn96D6yAS3JemcsjXFvNFjLWhz m0VU40mFlY/tS71sMNLdnx+1DCeaiXXJS9Ow7FsqOZkUJPZuSl9EMvLJnUr0/zGgWKvu pDMw8mVqYvR0g396V/hNNJcj5WvDME/dpGZD4Vxv7v5NbmR5wxE/4onO8Ke6M9SHCejY 9eR2GaZeDcyH0lA4LBZym2rm58EKNAWSSODRSUBP9lVe+SSHA9pzPcmnQqZvt8Vp4eLL pfFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a8+qsd5J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si2664671pgi.513.2019.01.28.00.36.15; Mon, 28 Jan 2019 00:36:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=a8+qsd5J; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726946AbfA1Ifq (ORCPT + 99 others); Mon, 28 Jan 2019 03:35:46 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34526 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbfA1Ifp (ORCPT ); Mon, 28 Jan 2019 03:35:45 -0500 Received: by mail-wr1-f66.google.com with SMTP id f7so17053254wrp.1 for ; Mon, 28 Jan 2019 00:35:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VkSTnXqzrCMNWST7wMAGuLPTbplmbXYm19BSa7E5KSQ=; b=a8+qsd5JDrF9KD0TGir/WgxzdA+0ldUML3QH6W1fZLWT615eYBrrSmDIA1qtXx4TRa Mk9poBiNrR0BxBbQ+AmSwp7+7F7qMrCi1AJDZhAPXwRan//YFjwruCtazo7WlCjkWQEf eZBcQb0lVGXxhaF2tk6QDsL2nb9AhUdb3HyTw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VkSTnXqzrCMNWST7wMAGuLPTbplmbXYm19BSa7E5KSQ=; b=GMvBQOwb3LBYnaUGEY8sn2ANjL2F7qGb0qr3WV44G6MmeynDzu6Wi7TrPNNWFYBsBe dc53EJ8gZHxbJl2DVp7kc7mCQSig8OrUGy8+deifJ/cF97jce9Q6iVrLwAX2CsJT2btF LPK/lFQqrMgVe+Zr76oC5EIJw8gh/ie9tn2ZRp4rVfClcHU/o01aNaguJ4Xshw5JyqA+ OCpZdU1fGnk2Yefaw+HQsmQfYONcnBStc1jkHD9MhzrMeK+iFAd5QsnQdXXn3tCiYAx4 og6DN0nfn4Stxx60XOkd/vrUReLwC30B+QBnWhxj9JsJB2eRMgUxsJUbkz8EH22F2uBA mefA== X-Gm-Message-State: AJcUukde4Jb6NyouhpPrlh58QGGBThaILSgR2tc6kw5YcAD8skaAX3IT dh7sW3gfng/CTDL2AwWlzalafQ== X-Received: by 2002:adf:a28d:: with SMTP id s13mr20024088wra.100.1548664543259; Mon, 28 Jan 2019 00:35:43 -0800 (PST) Received: from [192.168.0.41] (20.36.129.77.rev.sfr.net. [77.129.36.20]) by smtp.googlemail.com with ESMTPSA id x3sm110660108wrd.19.2019.01.28.00.35.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:35:42 -0800 (PST) Subject: Re: [PATCH v4 5/9] cpufreq: cpufreq-dt: Use auto-registration of thermal cooling device To: Amit Kucheria , linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, viresh.kumar@linaro.org, edubezval@gmail.com, swboyd@chromium.org, dianders@chromium.org, mka@chromium.org, "Rafael J. Wysocki" , linux-pm@vger.kernel.org References: From: Daniel Lezcano Message-ID: <52fd659d-b5a2-b0dc-b901-9bc33d7d6721@linaro.org> Date: Mon, 28 Jan 2019 09:35:41 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/01/2019 07:41, Amit Kucheria wrote: > Use the CPUFREQ_AUTO_REGISTER_COOLING_DEV flag to allow cpufreq core to > automatically register as a thermal cooling device. > > This allows removal of boiler plate code from the driver. > > Signed-off-by: Amit Kucheria Reviewed-by: Daniel Lezcano > --- > drivers/cpufreq/cpufreq-dt.c | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) > > diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c > index e58bfcb1169e..2a4c4ea7980b 100644 > --- a/drivers/cpufreq/cpufreq-dt.c > +++ b/drivers/cpufreq/cpufreq-dt.c > @@ -13,7 +13,6 @@ > > #include > #include > -#include > #include > #include > #include > @@ -30,7 +29,6 @@ > struct private_data { > struct opp_table *opp_table; > struct device *cpu_dev; > - struct thermal_cooling_device *cdev; > const char *reg_name; > bool have_static_opps; > }; > @@ -301,7 +299,6 @@ static int cpufreq_exit(struct cpufreq_policy *policy) > { > struct private_data *priv = policy->driver_data; > > - cpufreq_cooling_unregister(priv->cdev); > dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); > if (priv->have_static_opps) > dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); > @@ -314,21 +311,14 @@ static int cpufreq_exit(struct cpufreq_policy *policy) > return 0; > } > > -static void cpufreq_ready(struct cpufreq_policy *policy) > -{ > - struct private_data *priv = policy->driver_data; > - > - priv->cdev = of_cpufreq_cooling_register(policy); > -} > - > static struct cpufreq_driver dt_cpufreq_driver = { > - .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK, > + .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK | > + CPUFREQ_AUTO_REGISTER_COOLING_DEV, > .verify = cpufreq_generic_frequency_table_verify, > .target_index = set_target, > .get = cpufreq_generic_get, > .init = cpufreq_init, > .exit = cpufreq_exit, > - .ready = cpufreq_ready, > .name = "cpufreq-dt", > .attr = cpufreq_dt_attr, > .suspend = cpufreq_generic_suspend, > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog