Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3772207imu; Mon, 14 Jan 2019 08:46:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN4HEiM+a1QkKKG6G38/N1owDdCZtr1qfTUHKWmWWVd0dc3M1XHN6/i+4n+i7FMFg/+h8m6T X-Received: by 2002:a63:134f:: with SMTP id 15mr13436227pgt.19.1547484389640; Mon, 14 Jan 2019 08:46:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484389; cv=none; d=google.com; s=arc-20160816; b=vrU1ZKrRlinfwUbEENn9wFl6BPcEzVCQwC20KcBxeNlH3hsg4F5xk2lKWeTWuvL/15 J6+9awLzViGjzAN+CpR+22/oPyIAe1BLu5RUSCPVf4opbvCJOreNfuOVkuWQyzZu6g56 UjyDa7M0E51bNCPPZe0iB6xDOGovsVpJG7NoItiVaeUr6aX5bcPoQhgSONTe8R9MMUez NYRWiI/A32r6GGrm46qE5iPR7xAiNpFMU785oSUdOb+MOzcxzz/fpqHNMFkJKUv+EZWe 172R2pADmfMG5/noeS5enmm7uNHyuPt/iX0l/VjX9j/p66zz7e6P8/Q1UHJf3ym9QS4I 1sOg== 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=8jUWUXinqrIEk2wbCrHnyISvXX2O3vcX46RGBCRFza8=; b=TSx0CUWbEFc66DJHMLKcbApkLhpkXWEmu37mkJcvuVD53aUi1YdC6icdphIbD3ITMY 2pEWbwTO9RMXlzY/20VQOL1/VyR9wnddyuvXdUv8aBfN0yAgwvVX+UW94gZRvSJlkYCC 2BSivbsVrVxae+XNOxixc+kIincELDgIHUYqJLwF+/oaY3YEWGoPXVcG/vDOhaP80ypN ShwY/D0KaYQHg9FmduGvGL1mNWId360EuPGiUWF1g1OOjDHZX9JxN8Z4PrmunPlircd7 SLIDLIqKunMmhX++hNC42TM6SOZjKggE31CxkR8p8rl6LSO98uJ+OcllpZFFY4Zq6FaW s26w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CZRSEX9x; 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 i13si709632pgj.199.2019.01.14.08.46.13; Mon, 14 Jan 2019 08:46:29 -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=CZRSEX9x; 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 S1726954AbfANQnb (ORCPT + 99 others); Mon, 14 Jan 2019 11:43:31 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38321 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726778AbfANQnb (ORCPT ); Mon, 14 Jan 2019 11:43:31 -0500 Received: by mail-wr1-f66.google.com with SMTP id v13so23674562wrw.5 for ; Mon, 14 Jan 2019 08:43:29 -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=8jUWUXinqrIEk2wbCrHnyISvXX2O3vcX46RGBCRFza8=; b=CZRSEX9xhalKjgqG4U+P2MSdMyDo7y7Xr/ytxGZM78A+F/9DrRIo/KhQWHyj5c1d9U i7GpifF0VdNNm1c/Ky6ueBZzsUWSqv1swnoeLzzbJJIe6CwwmAHNO2t6g0/JRxI3QeEk 0VHkhylq59Tre+6qsnnEjgjbSOedrDEZjKMFM= 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=8jUWUXinqrIEk2wbCrHnyISvXX2O3vcX46RGBCRFza8=; b=tKQZqvQv51ryzE1shXw4oJdeXqOgObrBKAMXngiAyc7bFdb8oH622dC8+E01D9JZpr F+UkJIWm0UfCnzVz7Ul51GCi/PPodApnX8G2t0LNW5abftGAXsdPs1aueusG1Npc4SNa 373UWES+l19Vhd6MzpFAZzsAUcsvblBLkj0uUxMjL9mQO/hbXt5TZN/Bwcz49FFXdUUn N3inJDMueKOmkeqxzNCeCzbxNZqINSATE+9mv1KCUZU4gsfFN6zI5KooDIQ/C8sYIoo1 5VOkxjzZNMn8/mbYWOczx6nx+K2quGw/HeG1H3otLgb5gjv205RAbFzCsEooBVBq3f33 xsEg== X-Gm-Message-State: AJcUukcebymVIDmy9hGIZaFGpar6BvVORg1scTst0mjsyU24EB4rki75 9eXW7am3P6hHcaNhVlU4AX2Kt/RCrsTRlQ== X-Received: by 2002:adf:80cf:: with SMTP id 73mr25037001wrl.57.1547484208974; Mon, 14 Jan 2019 08:43:28 -0800 (PST) Received: from localhost ([49.248.190.171]) by smtp.gmail.com with ESMTPSA id f10sm7842762wmb.35.2019.01.14.08.43.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 08:43:28 -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 v1 10/10] cpufreq: scpi: Use auto-registration of thermal cooling device Date: Mon, 14 Jan 2019 22:05:02 +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/scpi-cpufreq.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 87a98ec77773..c01c63a342c9 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, }; -- 2.17.1