From patchwork Mon Jan 28 06:41:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 156699 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3089791jaa; Sun, 27 Jan 2019 22:45:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN62ul5ntSbriKI4+8X7Ie7gh4mGiWwaokeXat6dfz9yXWbhYzSj35QapZgAisClobEXlonu X-Received: by 2002:a62:c42:: with SMTP id u63mr20435353pfi.73.1548657925179; Sun, 27 Jan 2019 22:45:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548657925; cv=none; d=google.com; s=arc-20160816; b=y5xIym7wZHzSvJxmDuWtE19J5EKFyPPmsUyC16axKklcLKwl1S9L0gmfcaC4UBQKNx nCuL927HnTcHymaLlV8z0yo921rKU/SsEIcwEPOHjx37wbjFZDeVaHRiJTJDR2XEDtzT PhGt3/N/1Ccusp72SqM5wxWNoGrWmKd41TKhv+rvhgWSnmw3evciWARWb0L+exfH+JNp w+iqWBjzpZB1BHxoqdjfH7p4ggk8pbSYI6lh6LPuQZzKa1IzbBSG2wJQoczdVVyV1J2t U6PSY5wKSiIkLqTCNKdEMtHgCD8yS1uoYVwd9Dr/HJJW/dQg4Y6vEK3LIIGkFTYfKtyi Gk7A== 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=r/wRO1r808Pqs9EM2KfpMu4dvOgHIwgqkg0pHnsUhBtb/I3WFTlhrIJtqG/t9JmJgA MvPSw9FcX6uDNf9CU2JC4pixi990dDDOG5RP9oD2Tmi8fHM91HbvRZC2mwKmJpfRQMJ6 xBgI2PoHWiGWvMZZHwQM4angycRlFA6cCpIicU715qMfTurBLJZwaY5AaZy6XXMPtI6J VB3JuN/bhAHq+QVtZzFhJwC2GI3PoNB6Fe3dKYJqTziDFrr0eQ56lPNqW5cP+s1JCrZn p6Ze7usFAYmK/CuZMoT0mLzKkKfD95u9aH+WRqjAFOIcEwUBdAZIO0+fRJhYwA8ig9Ak G0Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ce0p9qg1; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 o3si21131240pll.201.2019.01.27.22.45.24; Sun, 27 Jan 2019 22:45:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=ce0p9qg1; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726632AbfA1GpY (ORCPT + 15 others); Mon, 28 Jan 2019 01:45:24 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34799 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726852AbfA1GpY (ORCPT ); Mon, 28 Jan 2019 01:45:24 -0500 Received: by mail-wr1-f67.google.com with SMTP id f7so16760760wrp.1 for ; Sun, 27 Jan 2019 22:45:23 -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=ce0p9qg1PNF/g2Mzt+MI/kYGEL51eAZQwxB7uptGywv/lzmD2j+/Xk6ndBMpNS4KLb BgeMs0xQ+O4I+rcGxJFGp/XhLxsOMO8EMccGK+zR497LstD56+kGZnGFeW48qV5hawtT AldDvDhXXBySYabj4WViQD7SKKWHLBn7vR/GA= 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=K9lXI4S/LMbF7p0HT/fzvu5u9jkpHzh0HHHRtRBQrW/l+Psq7Pe5xyOnYO1b3aKUfd 50fyzhSYKc2/c4lZZOh5LmoauEoFN7/VCkBDZd8RfBQFvt6w4DeFoAHG5nOGBmES3ZOg Vae5JTfvd4TCZpZHKcyQL1MeY4Jnby2J8+Vxnk0gco/tAk6ABlReMpDYpWdJphi2fNIM N0JK2LSLCgoS0/72ORlYwzJRQXfdUxLjP+JmhiE+ZiKtaT9eVOK7L/Ph8PPNrwU5vUTa Cedm77ZpfzHdimqDZd6vIWcTYiNIO96Ax09EU6fAhSPxeYWQ0LOD7JquSqufEw1L5uIV rhGw== X-Gm-Message-State: AJcUukfaBGZlyI3nGDE7vAO5RCWSCHnAWbtmRTz+yOXELFyHjXLuP+vQ nInqVmgCbVA9Ppb2cOaUty89pQ== X-Received: by 2002:a05:6000:1287:: with SMTP id f7mr21262511wrx.302.1548657922646; Sun, 27 Jan 2019 22:45:22 -0800 (PST) Received: from localhost ([49.248.191.44]) by smtp.gmail.com with ESMTPSA id q12sm44198894wmf.2.2019.01.27.22.45.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Jan 2019 22:45:22 -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 Subject: [PATCH v4 5/9] cpufreq: cpufreq-dt: Use auto-registration of thermal cooling device Date: Mon, 28 Jan 2019 12:11:30 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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(-) -- 2.17.1 Reviewed-by: Daniel Lezcano 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,