Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3224275imu; Mon, 28 Jan 2019 00:41:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN7VX26J+qXCLrvJU9c63bvhUJJNUe+kgEQ4FAr+IIkTqwx0RFPDVrOwmvnG/IhzFV9JER1D X-Received: by 2002:a62:4587:: with SMTP id n7mr20878470pfi.118.1548664870779; Mon, 28 Jan 2019 00:41:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548664870; cv=none; d=google.com; s=arc-20160816; b=D/knF2KWUv5tLpf2fYMgLrNZMAclszeiYrR2SlwzIMVEy8iHngGKXgOm4lNk8KNtRp B89y8y1ozgtg2s/NEKB6UeGl+2aSnwkLL8SWgeqO927EIaZh4M4iKY50JKccorzlCRLd CEo7Ns5yStmXXTI4E/eMb58ck8coNURwk5gCzXtsPC6pe+eZ75hT3uSeRW7F2rong65l 0zenRBajWNvxrC7vJ5+q8Ih9PmQJL47GGlqGQ4++gk7l7FJAu2qzQM7vOMseSSAY5ud7 G3xQ2x73wMtES2wpVbrzvPGkHvrOGwKe14g4mXXX0wNN8Zl6PF0yYp91/JE73B715g8O HTDw== 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=SdSKv6edgZBVQ7WdEt1pcKrXPGSSgiq6CrZoSJ1FdME=; b=pLz/DQsN69U95wwfdXexO69WP7tzLr0tXOUkUZ889vbFZKKqtFIrzs0WE2mZ0oBuoW UlIxgi68i7v+//DKJIi2CGp2463JIyrBm+X+qc9ZT1Bnlz2W0Qi+fH4vOfVXe8kuJJP9 Hi+lkmeSSZs0RfbmUA3q2w7n0IQFbusaqfS1JQmX3Pk6kfdf6AvFYZPnlaK0HK0YK9q1 t9djclTrg1swtulsn4zkAKvKCpH8xGxFpYAHpJ8l+9RlqYmehkexayHOlILlpWFj/PEM VUCjoxKFy1zO//FphrMWbIV/3PAAj7oGxTW0BB95c2Ju0HV47GdD1XkWbS8bsZ9FC0oh o+sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="BDg/7oUg"; 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 r11si29572750pli.175.2019.01.28.00.40.55; Mon, 28 Jan 2019 00:41:10 -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="BDg/7oUg"; 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 S1726887AbfA1Ikn (ORCPT + 99 others); Mon, 28 Jan 2019 03:40:43 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:34733 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726654AbfA1Ikm (ORCPT ); Mon, 28 Jan 2019 03:40:42 -0500 Received: by mail-wm1-f65.google.com with SMTP id y185so9832261wmd.1 for ; Mon, 28 Jan 2019 00:40:41 -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=SdSKv6edgZBVQ7WdEt1pcKrXPGSSgiq6CrZoSJ1FdME=; b=BDg/7oUgcbal0s32SJD5LAtc7/I6ZSXId8xCadLINpGSKHphRvhBCj81kUYEqXqogN HZaHfvVHlOyl4LDT1eIAAdXAw9F0+sXHTCenFep07Jj+jqvgCWbPKSqlE/+Go9dw1h1Z BnLNToG9q10+9kMTKIR6t6hJNHF5AelgjL/ms= 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=SdSKv6edgZBVQ7WdEt1pcKrXPGSSgiq6CrZoSJ1FdME=; b=rx7QfTdN+CLBTr8M6S/HgeMEnoZ3tm0LTgMcRp/tl0hXsrRcMua2XTihRL79y4uFTj No1Mb9b59he6cUsEWRyKfrJmyCRtzUu9vP8S/EKeib0M47k1Shnt1a2HeIqQ6fIV/XGm 7jnuw8XZGxNpdIhRoDomq0n2CTZnvJkjMfQ0ddTcWZND8ZXz/xfedQevrbON+Wj09nga Tq4gV9m+hAwDs92GP+kHmFNhr9je/hbZNPpL35FjSbWrPsjxCdVvcIXK4kQUBeHirBcj u8qTXiEZfpkX5vTlRcnLx1lXxL33DMF1JUNgBSpl8SvwQofE7MkWYTZs1hLVi3aiuiN9 VIkQ== X-Gm-Message-State: AJcUukedm9gz+JyOkXd8VGo6YPs6p8MgHwzznTllQKkk1vRRKs3i/LsM mSCQ7/7CpzGdwWU4Fyqz6kfkhg== X-Received: by 2002:a1c:b70a:: with SMTP id h10mr15517889wmf.125.1548664840835; Mon, 28 Jan 2019 00:40:40 -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 k128sm102490157wmd.37.2019.01.28.00.40.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:40:40 -0800 (PST) Subject: Re: [PATCH v4 9/9] cpufreq: scpi: 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, Sudeep Holla , "Rafael J. Wysocki" , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org References: From: Daniel Lezcano Message-ID: <5e1d4915-3c87-ea02-7acf-35b4f1ad3644@linaro.org> Date: Mon, 28 Jan 2019 09:40:38 +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 > Acked-by: Sudeep Holla Reviewed-by: Daniel Lezcano > --- > drivers/cpufreq/scpi-cpufreq.c | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) > > diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c > index 99449738faa4..82420e8e5f0d 100644 > --- a/drivers/cpufreq/scpi-cpufreq.c > +++ b/drivers/cpufreq/scpi-cpufreq.c > @@ -22,7 +22,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -34,7 +33,6 @@ > struct scpi_data { > struct clk *clk; > struct device *cpu_dev; > - struct thermal_cooling_device *cdev; > }; > > static struct scpi_ops *scpi_ops; > @@ -186,7 +184,6 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) > { > struct scpi_data *priv = policy->driver_data; > > - cpufreq_cooling_unregister(priv->cdev); > clk_put(priv->clk); > dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); > kfree(priv); > @@ -195,23 +192,16 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) > return 0; > } > > -static void scpi_cpufreq_ready(struct cpufreq_policy *policy) > -{ > - struct scpi_data *priv = policy->driver_data; > - > - priv->cdev = of_cpufreq_cooling_register(policy); > -} > - > static struct cpufreq_driver scpi_cpufreq_driver = { > .name = "scpi-cpufreq", > .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | > - CPUFREQ_NEED_INITIAL_FREQ_CHECK, > + CPUFREQ_NEED_INITIAL_FREQ_CHECK | > + CPUFREQ_AUTO_REGISTER_COOLING_DEV, > .verify = cpufreq_generic_frequency_table_verify, > .attr = cpufreq_generic_attr, > .get = scpi_cpufreq_get_rate, > .init = scpi_cpufreq_init, > .exit = scpi_cpufreq_exit, > - .ready = scpi_cpufreq_ready, > .target_index = scpi_cpufreq_set_target, > }; > > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog