Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp142050imu; Thu, 24 Jan 2019 23:06:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN7CTSnqjG7obdhUCknZ5W9SC0qLqoTvzopNMQIcTVLmhyzWhwmQWH5TMquG8YyXY/KA8OA9 X-Received: by 2002:a62:64d7:: with SMTP id y206mr9842782pfb.84.1548399963111; Thu, 24 Jan 2019 23:06:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548399963; cv=none; d=google.com; s=arc-20160816; b=qyc7inkUkHnsjWgAqeFoH2iUX0GL00WNEWK8mRGkF991VRxQJ5clQeO44HmuYZHw6T Ni78Rn2WFp6uDGIcyB0aRXVzJJs5sxGk8/saYrmRtF4atWdVDpPbqPcQsmiN35vESqdb oGjARwLrgiaaqJaaeutqH1mLQzloikZ+AMJyurfURhbBzRkZ+Um9XM9pqRhGelunJ0h9 6GMtGF0jlEHwxm1g2XnQ5HFlV+/djvljnKUcual02BjsvGLFUKHYgJp6xo3+foVs/YFD O9dlZlAXMlEoshVh/ZC+u4IjzAE75PuDTpDtaiL91Uii02byjuq/2sNBarRJXthkogC0 Ou8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=Jnh0TMw9avYu+uZabJgI1InZhBEwdJf7gCb6FqxHSVX96WMHofH3VS6DQD66tzOZ0L Bjp6sbM9je//LUvvJ0ZQPr6XfUGooXgshwklvBjeHPIn1BZYHiXIYYrm3bfEgw8XbjUO 4SNddgQGWEVlSW9r2qz/JwjGX0/UjzmTZ0KJnvBgQWDel0QVlJeUpRikAQp3IK97Cep8 r8nLO8xWJ2FKGeqV4x1TGDIpmb6o6loHiwTTlyKksWekan4g4yna3r2DT02VZdX6tZQw Mu8zmYFYSfON3Dq7tjOOkX8B1wegnqAyWSxhJYQeGvx153Ari8lH5fOIV0v4rmWBbHD/ f9hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GBHMSNqA; 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 z123si19237430pfb.104.2019.01.24.23.05.46; Thu, 24 Jan 2019 23:06:03 -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=GBHMSNqA; 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 S1728383AbfAYHDW (ORCPT + 99 others); Fri, 25 Jan 2019 02:03:22 -0500 Received: from mail-yb1-f195.google.com ([209.85.219.195]:40616 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728354AbfAYHDV (ORCPT ); Fri, 25 Jan 2019 02:03:21 -0500 Received: by mail-yb1-f195.google.com with SMTP id i6so3446108ybo.7 for ; Thu, 24 Jan 2019 23:03:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=GBHMSNqA6ShHtjwmgPgitPzf3OS+onfrjvdFO2ocI8NldpG5NHv7o7TsP0RMdkA1mw 0M5HfBlXeVCCP38rpGx92Snjzug5Xc1Org8gvRrfsICCbg8pTG5GaU6A1mT8gmJG1GRF ItEe9bb6dImdTacqjh5d1XyxEy7BWoe+qRgHQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=VCTPTsb3hhXVJcYVfhWRWca60qeRvuX3PhtST2TYIGD95T4x6L1aGVh2L93keit7QY Y51z+uJiLjoutf1MFtDvmr+GAFS8KpSmhgdDUrVkcJG4d4mjVIaWWOlr6+BbyVJz4tbk V9B2IuB1+IN+YTKsIodHtmeizyKuzFzJjFhqoPV57OsNkgICd79Q+ZEWzIPYVYJ7B9Z1 wIcUAagKRBLuQUKpyDxL8/lFXLbsFdtyk3RPb9qZnaq6ReVhM0LGR3HTbAB6xIREVMZB xFLO585SAk61CiN1nO6MZxwHCHA36lhHuUR6VzdzCDIRjryJVY5mg1AdLkwFwC6+wQNS jN7A== X-Gm-Message-State: AJcUukcVT7RpU6xXAdMcDTovI7dY6KGL9ho2wg7uqhLVqjoajKXtM/3N cSX94IwJQ52Y4Lw28m7Cs1GPnGz+mrA= X-Received: by 2002:a25:37ce:: with SMTP id e197mr9589228yba.63.1548399799997; Thu, 24 Jan 2019 23:03:19 -0800 (PST) Received: from localhost ([49.248.181.51]) by smtp.gmail.com with ESMTPSA id y187sm8940007ywf.50.2019.01.24.23.03.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 23:03:19 -0800 (PST) From: Amit Kucheria To: 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 (open list:CPU FREQUENCY SCALING FRAMEWORK) Subject: [PATCHv3 5/9] cpufreq: cpufreq-dt: Use auto-registration of thermal cooling device Date: Fri, 25 Jan 2019 12:32:25 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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, -- 2.17.1