Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3222316imu; Mon, 28 Jan 2019 00:38:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN6L6EPi9MZR59KoOmhKmQ1M2xIGI0H3mS/piX2V3XVspUEg+1Di8BFkzpl+IqNvFsrnnDfO X-Received: by 2002:a62:1c7:: with SMTP id 190mr21118559pfb.46.1548664702605; Mon, 28 Jan 2019 00:38:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548664702; cv=none; d=google.com; s=arc-20160816; b=V7L/kA4IOY+rdtvzs6fEQsnpFMqKOCM9w0QjKPkYaiyNtCQuG5Z3Qjq163dVx/cWbr 6wfjuyx2u5NwKeY/KrOnEIRhqaTZN5IDHYTEqYf+1jMH1lGQDYMJogW9Y+xgBWAlyVPO lEKn19JBMhU1lRYAws3T4R26lSdjfHEn3g4/ZSdJEMdmmSEVpP6/nBQnKXuDp7Qyh2BO X/rI728xxgYdR6XydMx9vlh3kDX65vMQJz+vS1Hk3mcaodzkJkxzi4lkAJyCFcJFEgbE GvoDsyiYHPVEqF2o41T5atpyWn+TlJlAa0pTZ0vpJpkMAfqzqyKYmSjR9aViXm09MlhZ uUaQ== 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=SO5+bXuAqPyJH922wYcVV3iI/pHeR6WqGnn2Q+wNYMI=; b=Ea9HYHyXI7+vAgZotQEWwOofJmft3U67WnNWfK7cDYXiEzXcR87BNbnSB3fHGXTLeA 202XzGjC0bbUgXbTmfZLI7hMvzfDOM4lLvy3ehOcVMnl4Y8rv+8cRPdrabMJdQOHdZmz 0SJ052o5Z47FLTSM0JFhpcY7HOPT2mTQBYIrhFSLt7rJUoPwKrf0Uw4FpFcb5E23Vukw FKCORKMjskD+vUbfq2Hy13GZqId6Uc/GcyCmeU9WWxitdmW9FLeAeGxbUUjkxUlH+3sX jE/bhY+wtK3ODs4+xLvofG2QuVl1SNXWubyNc4JGhuNcu6m15/OZmZMTMq5xSIY5CeqT R1ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="b2G/UtDh"; 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 r81si36198933pfr.164.2019.01.28.00.38.07; Mon, 28 Jan 2019 00:38:22 -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="b2G/UtDh"; 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 S1726977AbfA1Ihx (ORCPT + 99 others); Mon, 28 Jan 2019 03:37:53 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55234 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726879AbfA1Ihw (ORCPT ); Mon, 28 Jan 2019 03:37:52 -0500 Received: by mail-wm1-f68.google.com with SMTP id a62so12967129wmh.4 for ; Mon, 28 Jan 2019 00:37:51 -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=SO5+bXuAqPyJH922wYcVV3iI/pHeR6WqGnn2Q+wNYMI=; b=b2G/UtDhDLURhsdW/SLzkLP9DH9j+mUmD0iYx/FKTSMm/twiCLZcKx/UQ7knz0KMhq oHE2a7db2lgXrVpbeDxwksgsPsMd5+a+qP34sSMqDFUD7GgK4nu9XZumI3Vm9BAAOY5R IeAB3AzGUFiDE/JD/Umwqjp1T6ikpfCvV+Awc= 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=SO5+bXuAqPyJH922wYcVV3iI/pHeR6WqGnn2Q+wNYMI=; b=ImES4mKvr1f0x6MXgT2g6bYaSJdxKz1uOwhmhfPvR7Xkt3N/uJJl7z03OVD1vw7wtK I7Zr33UOQg5XxcOPPOwx8DklNS1e1j1TWgAjSBG0m6tJkhkS3ylYyQr6P7fH0hyXOVHb JTWzDkRlWPluU59jEBNkxnDRcSQDLJJn7ephdfEoSctbaXSFHX2ea6HPp0CsHN9BRAv6 jqVgsMvHRCcWIeHNUuUM0or91X5qQ2LsfQg4by2kWU1pBgfw00w5B4CvvlKcjuqBdNO/ WvBSyLqgl8jNi8juoKQNv0md/kPMvXx17Ix5/8zjukjaZ+HWaArU4Dqa0i5bU3zvp4O1 4SQQ== X-Gm-Message-State: AJcUukdIJvWXBhlaEGWqWfoccEG3cfiu73mUdRCQyPjdi/qHetvAC7jZ lNqlyGFmI95/N0+9IabfHR77o5PD6kQ= X-Received: by 2002:a7b:cb0a:: with SMTP id u10mr16682140wmj.0.1548664670509; Mon, 28 Jan 2019 00:37:50 -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 w10sm8399019wmb.1.2019.01.28.00.37.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:37:49 -0800 (PST) Subject: Re: [PATCH v4 7/9] cpufreq: qoriq: 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" , Markus Elfring , linux-pm@vger.kernel.org References: From: Daniel Lezcano Message-ID: <1b5ecceb-f7b4-903b-4158-394618fab8d3@linaro.org> Date: Mon, 28 Jan 2019 09:37:48 +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/qoriq-cpufreq.c | 15 ++------------- > 1 file changed, 2 insertions(+), 13 deletions(-) > > diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c > index 3d773f64b4df..b206e6cb55f0 100644 > --- a/drivers/cpufreq/qoriq-cpufreq.c > +++ b/drivers/cpufreq/qoriq-cpufreq.c > @@ -13,7 +13,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -31,7 +30,6 @@ > struct cpu_data { > struct clk **pclk; > struct cpufreq_frequency_table *table; > - struct thermal_cooling_device *cdev; > }; > > /* > @@ -239,7 +237,6 @@ static int qoriq_cpufreq_cpu_exit(struct cpufreq_policy *policy) > { > struct cpu_data *data = policy->driver_data; > > - cpufreq_cooling_unregister(data->cdev); > kfree(data->pclk); > kfree(data->table); > kfree(data); > @@ -258,23 +255,15 @@ static int qoriq_cpufreq_target(struct cpufreq_policy *policy, > return clk_set_parent(policy->clk, parent); > } > > - > -static void qoriq_cpufreq_ready(struct cpufreq_policy *policy) > -{ > - struct cpu_data *cpud = policy->driver_data; > - > - cpud->cdev = of_cpufreq_cooling_register(policy); > -} > - > static struct cpufreq_driver qoriq_cpufreq_driver = { > .name = "qoriq_cpufreq", > - .flags = CPUFREQ_CONST_LOOPS, > + .flags = CPUFREQ_CONST_LOOPS | > + CPUFREQ_AUTO_REGISTER_COOLING_DEV, > .init = qoriq_cpufreq_cpu_init, > .exit = qoriq_cpufreq_cpu_exit, > .verify = cpufreq_generic_frequency_table_verify, > .target_index = qoriq_cpufreq_target, > .get = cpufreq_generic_get, > - .ready = qoriq_cpufreq_ready, > .attr = cpufreq_generic_attr, > }; > > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog