From patchwork Mon Jan 21 15:40:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 156217 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6517324jaa; Mon, 21 Jan 2019 07:45:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN6iqpAiBEEXNJdwOdl3zcZHZukPUE0hxuLCEbYMrItFhQUqkywETQTSuyzeQ6O+AGZiLFkT X-Received: by 2002:a17:902:b83:: with SMTP id 3mr29299233plr.42.1548085534993; Mon, 21 Jan 2019 07:45:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548085534; cv=none; d=google.com; s=arc-20160816; b=uqoDgsLX7OZnKcGTyPvS0wZwPoNzhffP/FIYRpUuKe4Km1RkcecTSDUrvgP66ey1/O cvt03AZsHDVPETNBtcqkUf+Y+tySaRBvh0p05oewWDnSYOdOKLP5smH7+EQlKa3qR4HK 4Tcl8visDWQg7paduqxP/gpG4sDJDePKLjtQwLMPQF6A1dZHiSFpHwzFuY2EhgRFAU2I uNn0PEZkAe5CvoP4IwP9XslD1ZCfBiyWQSjruuKlrsI7Wo1SCGNTztf3VgSzQHCvFJcG +OzM9up5aYz2S7IpcMFIx31crHR666CnL3f4GmyEhcQN+oqaF0rf8mpQT/+YxbsmtbIp QAig== 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=T0qbmuuRPxDVtPya/S7z9HnIzaHUQLSLFndkXz9dAlg=; b=gMtkaVNXd+748oBvB5FOVBCtAfqi572QzaVzjIPHe136jr0BTviFhslyeop1yXCnO0 ezYyYaF2ccmOsuuA58+hKF9zrj1ZdCs4ZbL8aqfz47GA3Ff6x2l0tZoY61iVcYXaYjUw NtXEBftmjdJhM1no2RVF0UpuGQBT/kqTPgZRFk4XkConf9tbxRbYKS3y6orjVqUTWRt8 5lbXPDKRLvGqmt8eKXZodaLPTXCTllx7uYGHG4Zrk4jshBxZkSFvdzXSatsGDZsZem0A O+pJTPMFDWUqecDx/sksk5cPusSJH+xJxt72SYEP4XMRu4Nm9u5LO5+DNPSW8Qx0IdAx jjzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="aa1WM//w"; 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 bb4si12772657plb.322.2019.01.21.07.45.34; Mon, 21 Jan 2019 07:45:34 -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="aa1WM//w"; 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 S1730459AbfAUPpe (ORCPT + 11 others); Mon, 21 Jan 2019 10:45:34 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39722 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730295AbfAUPpd (ORCPT ); Mon, 21 Jan 2019 10:45:33 -0500 Received: by mail-wm1-f66.google.com with SMTP id y8so11214654wmi.4 for ; Mon, 21 Jan 2019 07:45:32 -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=T0qbmuuRPxDVtPya/S7z9HnIzaHUQLSLFndkXz9dAlg=; b=aa1WM//wBsKs9dqORTa7wBVQcRD4lPDGGwYTXHzgbzFvML2quBZsRMMuo53RsRAM7e DiiUzMoO3bspcol3RGnucuMb6t6TwiXWcuWil28ria+MDGNnKBx/gSJ646n2h6FTcFdD 2je3WG+tkpjMfbQt6bnWmcQgL7zT+j/XbcSsQ= 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=T0qbmuuRPxDVtPya/S7z9HnIzaHUQLSLFndkXz9dAlg=; b=oFydsguFc5wXwxLeX8AXZatoLf+eBEmRJe/+JSno1Ugtl775wV91uxzrJ4aOQTeBD6 xJ3zA2Lj5J+nzukkTKgr2nsp7WHjZPptBs0vcuASFlbhcrO/9KG7vUJ/9iqjFNuytoU9 9pbCUHAOmzVseU84kKGhSxt27J/tuNmsqgiNj3ejPUGWzjaBznB5boD1v96xGxK14e/m iWHqJCT3vuxxgi469i8xtR4ivk2f2+841NPUS8ysHNQ+ZCHO7u0KtKcrCu5h0hMSk1Zk oF/052ncl5mZZ74bXsAm2grqnoRPRPgw+EYmlMDT18NYPXS1cvA9q4Qs9EelHjKzCOiY gVEQ== X-Gm-Message-State: AJcUukcbzA+elKvh3rZPkM2P+4JI5PthiPY6hIJGr4kgIMLd0GSHPunj EfvVyqfU3yc5T0Gw1Q6WpHjfKA== X-Received: by 2002:a1c:87cc:: with SMTP id j195mr24943011wmd.2.1548085531754; Mon, 21 Jan 2019 07:45:31 -0800 (PST) Received: from localhost ([49.248.61.1]) by smtp.gmail.com with ESMTPSA id l14sm191132944wrp.55.2019.01.21.07.45.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 07:45:31 -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" , Markus Elfring , linux-pm@vger.kernel.org Subject: [PATCH v2 7/9] cpufreq: qoriq: Use auto-registration of thermal cooling device Date: Mon, 21 Jan 2019 21:10:32 +0530 Message-Id: <1c0f7a96c926e313569e0baf10d6d730f7ee1b23.1548084260.git.amit.kucheria@linaro.org> 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 --- drivers/cpufreq/qoriq-cpufreq.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) -- 2.17.1 diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index 3d773f64b4df..b206e6cb55f0 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -31,7 +30,6 @@ struct cpu_data { struct clk **pclk; struct cpufreq_frequency_table *table; - struct thermal_cooling_device *cdev; }; /* @@ -239,7 +237,6 @@ static int qoriq_cpufreq_cpu_exit(struct cpufreq_policy *policy) { struct cpu_data *data = policy->driver_data; - cpufreq_cooling_unregister(data->cdev); kfree(data->pclk); kfree(data->table); kfree(data); @@ -258,23 +255,15 @@ static int qoriq_cpufreq_target(struct cpufreq_policy *policy, return clk_set_parent(policy->clk, parent); } - -static void qoriq_cpufreq_ready(struct cpufreq_policy *policy) -{ - struct cpu_data *cpud = policy->driver_data; - - cpud->cdev = of_cpufreq_cooling_register(policy); -} - static struct cpufreq_driver qoriq_cpufreq_driver = { .name = "qoriq_cpufreq", - .flags = CPUFREQ_CONST_LOOPS, + .flags = CPUFREQ_CONST_LOOPS | + CPUFREQ_AUTO_REGISTER_COOLING_DEV, .init = qoriq_cpufreq_cpu_init, .exit = qoriq_cpufreq_cpu_exit, .verify = cpufreq_generic_frequency_table_verify, .target_index = qoriq_cpufreq_target, .get = cpufreq_generic_get, - .ready = qoriq_cpufreq_ready, .attr = cpufreq_generic_attr, };