From patchwork Mon Jan 28 06:41:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 156703 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3090833jaa; Sun, 27 Jan 2019 22:46:56 -0800 (PST) X-Google-Smtp-Source: ALg8bN69TLcN4GLjZ3bvbcxuL0GZ0cDKOLPyxuTeWdfn0EpYarXfbvbO/0siFUv2j3Ic3d/2jqPF X-Received: by 2002:a17:902:7005:: with SMTP id y5mr20766461plk.7.1548658016121; Sun, 27 Jan 2019 22:46:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548658016; cv=none; d=google.com; s=arc-20160816; b=s9GRzarz8e4VqoyaYLvkPx1pCW20XxQjyB+2r1AlmGMU8bY4H+4Bu9/Up//vLJ2/UU rBvPuTVGXC00WaZOzsuqWF30DA4lYdq8ODDcjvlNe0LBz3wLENuMYAP3vHaNs+6htynn N71w08X6x1o72sK8AGRM3WKdzMgNe7CbOsDV0iUyALjmChbXxWJdm7bllFhRf0AgRjml kmklwrdxiePTE+hevq1cQVm2EGD9yBa6/eSlZBVUFk5jkdvnYCyMxyMpSLpQtWPNQkJ3 x9sGHKjh8Y1fzbud13WjFwYV5abHnSyJshdh7T1jNNGLCX4hJnGISwuT+eA4PGQNO8+C kvSw== 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=lmDIKADatw1oUeQ5UHUMSZddpdBoEMSbYiY1RQRpnEA=; b=U9HhlCmah4j/uzFtg4qZcWQrWJ1QeWqx9Kd/jbqo0NlXbRpJLpeiJ9vKzTE7dQUHLU sRaytt2AUJBcXZcz5x6U74MaKJhcH4E2xoidElUxHbLcNcMAMje5FtSgRDh5YI5MYhBN u/bX2+MgTL3Pv/dNYM7TQ+rekW+VCYJ22XmAQBEF6yOGjywzAmG8K7KwD1uzlBvJ8Jqs FCDaOxHGmQsMdeoeHWjNw3OhARHsl00Kv005gtYJL4Xjf/oA1iaq9vqUgdDK4AvsPqGX UklAGeZHH02XGlCeYFihclW2VSHMwfDBzeom/KKkjr466mBm8vHkYDsjCnMMrZ9Edggg Uz4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ONUvgNzN; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 w12si4494229pfn.212.2019.01.27.22.46.55; Sun, 27 Jan 2019 22:46:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=ONUvgNzN; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1726661AbfA1Gqz (ORCPT + 11 others); Mon, 28 Jan 2019 01:46:55 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:36202 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbfA1Gqz (ORCPT ); Mon, 28 Jan 2019 01:46:55 -0500 Received: by mail-wm1-f67.google.com with SMTP id p6so12555065wmc.1 for ; Sun, 27 Jan 2019 22:46:53 -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=lmDIKADatw1oUeQ5UHUMSZddpdBoEMSbYiY1RQRpnEA=; b=ONUvgNzNgC8g3iZPKMxdM8Gx1l/rUdqraqCco0IlE7riwGoAF0KYN3xomg9e4bRUbc HrWCxAbbr1zI0fmM5bLxSSgRUC6DF35LLtHeDyu7OFOpNczyaJ+/k/FusKHXx77SZQB7 w/TyXnnGQDgbgQSAPvzpl4DTEkTgxXwYMKnMk= 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=lmDIKADatw1oUeQ5UHUMSZddpdBoEMSbYiY1RQRpnEA=; b=dZQlYbgZeqxB4xdR0odQWMdvT7ZSvd85PkDwe0QvDPx2aPOQUlwdzp2R+Ypjcm6t4H YZxyaqSpZDwlvYEx6sXv/o1FgFMw6+OOZZv7wk5y+8erfaieUREuiNOiC83aWpMplYjA PESTRrtzjoUsB9FMsO8OPQHTWkS/HGgQdblASsKq8+Pcs/Tffcy3utppjiVoI1lE8ZGZ jrMmP1AnoGUyC630ACJd9Mxz9anDCLMQ/0lGeA4hexd2DnP4iTlgN72JIigyGSlCXPdC UacCVCWT7xP6xCv73XV1rc+nnyLTrCZ3pScQyp0WRZUpZCFOvDN4aavkxGvdPhLI+xib GwEg== X-Gm-Message-State: AJcUukcyfcqZIVz/IKvqATpAKHLAnfjrylrhNvvFAGNHY4/Lxw2c973p YX7q8dXNh17SPN1ouAmlEjvgfQ== X-Received: by 2002:a1c:cbcb:: with SMTP id b194mr14651461wmg.64.1548658013127; Sun, 27 Jan 2019 22:46:53 -0800 (PST) Received: from localhost ([49.248.191.44]) by smtp.gmail.com with ESMTPSA id n5sm112413370wrr.94.2019.01.27.22.46.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Jan 2019 22:46:52 -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, Sudeep Holla , "Rafael J. Wysocki" , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH v4 9/9] cpufreq: scpi: Use auto-registration of thermal cooling device Date: Mon, 28 Jan 2019 12:11:34 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 Acked-by: Sudeep Holla --- drivers/cpufreq/scpi-cpufreq.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 99449738faa4..82420e8e5f0d 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -34,7 +33,6 @@ struct scpi_data { struct clk *clk; struct device *cpu_dev; - struct thermal_cooling_device *cdev; }; static struct scpi_ops *scpi_ops; @@ -186,7 +184,6 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) { struct scpi_data *priv = policy->driver_data; - cpufreq_cooling_unregister(priv->cdev); clk_put(priv->clk); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); kfree(priv); @@ -195,23 +192,16 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) return 0; } -static void scpi_cpufreq_ready(struct cpufreq_policy *policy) -{ - struct scpi_data *priv = policy->driver_data; - - priv->cdev = of_cpufreq_cooling_register(policy); -} - static struct cpufreq_driver scpi_cpufreq_driver = { .name = "scpi-cpufreq", .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, .get = scpi_cpufreq_get_rate, .init = scpi_cpufreq_init, .exit = scpi_cpufreq_exit, - .ready = scpi_cpufreq_ready, .target_index = scpi_cpufreq_set_target, };