Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3221098imu; Mon, 28 Jan 2019 00:36:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN5DcSKN3p8W6iGBDBI4miooYMDkJPsb5pDv+d7QfsiUpCZSaBcgcToZeSAVTq9ooq1zX6Pz X-Received: by 2002:a63:d604:: with SMTP id q4mr18821137pgg.175.1548664595949; Mon, 28 Jan 2019 00:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548664595; cv=none; d=google.com; s=arc-20160816; b=unKt6aen/O3Vx5gh26LyGv0fWNNX86of6ntOvBcnHX1UJ52IXMUq8o778hP9QWK6db o3o3T+rbQKkJxT7LAwAcyme6iwrAHCPQ4jJWXR/WSOR/uphx5GKlBbeN2LBwk4BiQgr8 Pr0kyztk0cCm+DFsyNcDuKKuT1g4ILGQB8Umq8zqa/5KRLzYDvLHs6dSrCkl3mDQAvRl WflylUf+kQzqKRSoAJXfIyT0bpb97yBJV++tsfEeJv40IzqUkthfvSFS20mOvNb5jIrY 4/75dU8jO3xD+vDcPacK1m6zpCOcGj7J6Fgq1LF8rU1tfmmf07WFFbkPqvNVSliynYUE ZcbA== 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=vECWysAQwMTzD/v7QsHss+btOnUKdafIfBPM3+i2WAU=; b=d8+7vv/PTNykBlSph7+uS6mzHCSfygj7puJf9buf0kfif9La86dbcGUUBuv7Mdm/v3 XDy5Hn6PU+lgU0DdRBP3bghdvQ8k3Wdgk+9QqnCt0zFedHpn3LUJlvrDiubJH8fYRLiy zCYEz5ClCDRmVtU6pLI5SZ085w8wnYcQx5nM2FJQxAQP76ya0sbPAQyUgmUIjQCJnxk5 Mw8gKSqC0B3ICnsjcPVMhR5vSjAlGTj6GNdOg8oI+jpzJYIk+hd5DKkROXFTdgqSCmJ0 XSulpHeW7fug8Qt2Xiam03jF7VL/vZStsYjxEj/zGueJZauOLO5lkDg37JV6S8KqXZVd bCXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D20g2JoL; 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 i63si31638086pgc.116.2019.01.28.00.36.20; Mon, 28 Jan 2019 00:36:35 -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=D20g2JoL; 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 S1726970AbfA1Ie7 (ORCPT + 99 others); Mon, 28 Jan 2019 03:34:59 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39998 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726853AbfA1Ie7 (ORCPT ); Mon, 28 Jan 2019 03:34:59 -0500 Received: by mail-wr1-f68.google.com with SMTP id p4so16983511wrt.7 for ; Mon, 28 Jan 2019 00:34:57 -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=vECWysAQwMTzD/v7QsHss+btOnUKdafIfBPM3+i2WAU=; b=D20g2JoLJVUhI1kqjVHnjTo4xklEyoSELd0hsk2lGNA6k6aJ9ELikUlE4g5SL1LHl7 pcnkaLymn2jawV/DsYXh/GJwutNW+sZ7HCi1lqoPsxkibyWy3+GrhpvFKNhWc2RkmQhG DDzF1YXzK0h7I2Lvoga6/lgXDQ8P3AeNlMbAs= 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=vECWysAQwMTzD/v7QsHss+btOnUKdafIfBPM3+i2WAU=; b=Or5mBTnI1FWdYF6Z9oa/n4K5avvcnfiVE0QB60TvzTjZT5iVMmhMnSKD4hDb+oqNIF ZY4vV/IHWno5eskNfPFjnr/SeHJOIkdjTHupg8cnM5ulalfr7+amrAkoRsA0eFX4h587 8d7pjOX4DP60fHoUqZ7lwMzGJlowCKJmOOi343mI+Wlg6d8O0YSXTIH21eSUpgdwe7xD Bvc47fueKIK60943NqWNc/nrT3wW+gykZ126PDYn6Bs01ls2SDDcAuOrRi1zcXMvvFN+ px65YJp81OjxJID+t/Usab7i92iRoPFhGAz80+w2Grx2azeGNxBsRBCsvs1bDAJ3xKMR yJQw== X-Gm-Message-State: AJcUukeox+A/6o4lZ9AczvYYjQ4qoZlwtc1Rr0YyOV3lkDhvSPtST0hP Td756IViVz5BspNUaemHVsEBmw== X-Received: by 2002:adf:fa05:: with SMTP id m5mr20359262wrr.155.1548664496833; Mon, 28 Jan 2019 00:34:56 -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 a1sm97375419wrw.76.2019.01.28.00.34.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Jan 2019 00:34:56 -0800 (PST) Subject: Re: [PATCH v4 4/9] cpufreq: imx6q: 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" , Anson Huang , Shawn Guo , Bastian Stender , linux-pm@vger.kernel.org References: <6e8ab1213d82b6de5294c0f579a24150aafaf558.1548654899.git.amit.kucheria@linaro.org> From: Daniel Lezcano Message-ID: Date: Mon, 28 Jan 2019 09:34:54 +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: <6e8ab1213d82b6de5294c0f579a24150aafaf558.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 Reviewed-by: Daniel Lezcano > --- > drivers/cpufreq/imx6q-cpufreq.c | 24 ++---------------------- > 1 file changed, 2 insertions(+), 22 deletions(-) > > diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c > index 9fedf627e000..9935df234fa1 100644 > --- a/drivers/cpufreq/imx6q-cpufreq.c > +++ b/drivers/cpufreq/imx6q-cpufreq.c > @@ -9,7 +9,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -52,7 +51,6 @@ static struct clk_bulk_data clks[] = { > }; > > static struct device *cpu_dev; > -static struct thermal_cooling_device *cdev; > static bool free_opp; > static struct cpufreq_frequency_table *freq_table; > static unsigned int max_freq; > @@ -193,16 +191,6 @@ static int imx6q_set_target(struct cpufreq_policy *policy, unsigned int index) > return 0; > } > > -static void imx6q_cpufreq_ready(struct cpufreq_policy *policy) > -{ > - cdev = of_cpufreq_cooling_register(policy); > - > - if (!cdev) > - dev_err(cpu_dev, > - "running cpufreq without cooling device: %ld\n", > - PTR_ERR(cdev)); > -} > - > static int imx6q_cpufreq_init(struct cpufreq_policy *policy) > { > int ret; > @@ -214,22 +202,14 @@ static int imx6q_cpufreq_init(struct cpufreq_policy *policy) > return ret; > } > > -static int imx6q_cpufreq_exit(struct cpufreq_policy *policy) > -{ > - cpufreq_cooling_unregister(cdev); > - > - return 0; > -} > - > static struct cpufreq_driver imx6q_cpufreq_driver = { > - .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK, > + .flags = CPUFREQ_NEED_INITIAL_FREQ_CHECK | > + CPUFREQ_AUTO_REGISTER_COOLING_DEV, > .verify = cpufreq_generic_frequency_table_verify, > .target_index = imx6q_set_target, > .get = cpufreq_generic_get, > .init = imx6q_cpufreq_init, > - .exit = imx6q_cpufreq_exit, > .name = "imx6q-cpufreq", > - .ready = imx6q_cpufreq_ready, > .attr = cpufreq_generic_attr, > .suspend = cpufreq_generic_suspend, > }; > -- Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog