Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3223372imu; Mon, 28 Jan 2019 00:39:51 -0800 (PST) X-Google-Smtp-Source: ALg8bN7GPDQyIkxal8fJCIOGG3ybtbjQumyfV1t3dDQKLJ2P/NoRqvtfXnfw5lII+/q/PXYVOE2u X-Received: by 2002:a17:902:7402:: with SMTP id g2mr20381285pll.198.1548664791241; Mon, 28 Jan 2019 00:39:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548664791; cv=none; d=google.com; s=arc-20160816; b=VYGTn/ZsGesrutS5Mq+4+YXctMUhLQw4eoYraEYWw2kts48vor5CAF/YjaHih66vC7 l1SbFqJPMB69e1rFgHKyUkMZzg7//hZ6TlPb2S92HOfnUIB6u/ZaSTlgi/DpHA4lMrpc mmefi4yBpI+Bu/VngmGWxhTSn9pRQhrqRzKImtS5YZSjEWc2TKbZ34GTZwgjlWHcZ+I3 wlwZMo1NaU+E/7vlcQz/A2hH62Iots2cPI1WOZXGl2nTjvVL4GA2eG4NBJfnBZ+oZqCt xk8dxnqsJ2JVZ0FzipbjTdOTUOxW6yYYG6O5znEKDEy+KUh899aOm44QrFsfhi7aueO9 4FSA== 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=HvCmuadj0C3VfhNvieaFfPciyvU0URb0jZw5i6fE1eQ=; b=kVZmJIbBg6c3KyzU4p3RkfE/wZoh8WBdEB+qc448QzF8s0PERdybhV0TXFHv+IEE9Q mIZ0sfBvoSKN5fLZoWHBQbH78Hqxy9W1SODjYOZ3HrrlnjeaYdw8eaOefm8hHh1rX8sT gqw5f12MGsmkNd/e+R3b9m2so9mnHFFzJeJTfPDuEaKf5ax2+4cuUaRvuzmpN5Kz9hDC F/iwzPrXGZHjwUzLKbj8A/FoqmMjgt5ZGqYrECpOSJPpOCYwVooLGz9OUzXhFruedkcL wqAxaPQImRYimf9LVZQE+9vHx/+B52xCJoKN9tUtpWXovdGBW0y/ufomZcpxghfx40mu NeWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=B723pNcz; 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 34si25817562pgt.455.2019.01.28.00.39.35; Mon, 28 Jan 2019 00:39:51 -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=B723pNcz; 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 S1726775AbfA1IjX (ORCPT + 99 others); Mon, 28 Jan 2019 03:39:23 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:44296 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbfA1IjX (ORCPT ); Mon, 28 Jan 2019 03:39:23 -0500 Received: by mail-wr1-f66.google.com with SMTP id z5so16959442wrt.11 for ; Mon, 28 Jan 2019 00:39:22 -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=HvCmuadj0C3VfhNvieaFfPciyvU0URb0jZw5i6fE1eQ=; b=B723pNczchkl703bz0+GZNNPX2lJFzG8gZsIagGCv3zYMg3H/R9MEc43d/KYfhl0mr JPEsFKac5+VoU4GB5GerekvdiXsOGHBTzSRk++ZDcIFHzH1uGtDgwYp0lSZt79KqqcwN AjLdtThJWUCe+y7CxqyhUZm/OyYkhjskKfNaA= 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=HvCmuadj0C3VfhNvieaFfPciyvU0URb0jZw5i6fE1eQ=; b=qkC2D+loApULcXOIXxTYf+xDtiODWhRJN4x5sLlcS6TEm+OAuKsuFN12B3ZnrYnFfd cVPGZh9SziAmLgEO1/4QQr93rB54AB/4noG7evfGPyaf69OBOzwgiaF8qjBfp2ofNmZ8 XjFJOu822ZovrLc4kNCOpbpmzpyangH4ygAgf/hnz95x8/2DB2NifbgTRa4q85cxlK2B 4kh0Xzdlod65ydyyi9ErbpHgb7BbZskm8Oi0NAQy1B4UT6rusjToBH8KQ7Dilxb1bVCT YTL1JD3oV43BBa+8ruLSX+GQ0xUKCSFzCp/PjrJnKaq+psZDTIKR6WWFpu+YYiwtBr6Z 5Qkg== X-Gm-Message-State: AJcUukfSdyldDe+IOLG2qd7x0KZb66cMmpUpNisxVQBRK8Nt5x4m2Dj9 th1/1AaPyv2vbPkZG8PeQZftZg== X-Received: by 2002:adf:f1cb:: with SMTP id z11mr20530227wro.35.1548664761341; Mon, 28 Jan 2019 00:39:21 -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 h2sm128227075wrv.87.2019.01.28.00.39.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:39:20 -0800 (PST) Subject: Re: [PATCH v4 8/9] cpufreq: scmi: 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: <81d81c0016fb275728b7b604020c22d8f53991b1.1548654899.git.amit.kucheria@linaro.org> From: Daniel Lezcano Message-ID: <49b6cb24-6f38-750d-e652-cc4e47f96db0@linaro.org> Date: Mon, 28 Jan 2019 09:39:19 +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: <81d81c0016fb275728b7b604020c22d8f53991b1.1548654899.git.amit.kucheria@linaro.org> 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/scmi-cpufreq.c | 14 ++------------ > 1 file changed, 2 insertions(+), 12 deletions(-) > > diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c > index 242c3370544e..b19e9d129f8f 100644 > --- a/drivers/cpufreq/scmi-cpufreq.c > +++ b/drivers/cpufreq/scmi-cpufreq.c > @@ -11,7 +11,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -22,7 +21,6 @@ > struct scmi_data { > int domain_id; > struct device *cpu_dev; > - struct thermal_cooling_device *cdev; > }; > > static const struct scmi_handle *handle; > @@ -185,7 +183,6 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) > { > struct scmi_data *priv = policy->driver_data; > > - cpufreq_cooling_unregister(priv->cdev); > dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); > kfree(priv); > dev_pm_opp_remove_all_dynamic(priv->cpu_dev); > @@ -193,17 +190,11 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) > return 0; > } > > -static void scmi_cpufreq_ready(struct cpufreq_policy *policy) > -{ > - struct scmi_data *priv = policy->driver_data; > - > - priv->cdev = of_cpufreq_cooling_register(policy); > -} > - > static struct cpufreq_driver scmi_cpufreq_driver = { > .name = "scmi", > .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, > .target_index = scmi_cpufreq_set_target, > @@ -211,7 +202,6 @@ static struct cpufreq_driver scmi_cpufreq_driver = { > .get = scmi_cpufreq_get_rate, > .init = scmi_cpufreq_init, > .exit = scmi_cpufreq_exit, > - .ready = scmi_cpufreq_ready, > }; > > static int scmi_cpufreq_probe(struct scmi_device *sdev) > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog