Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6370499imu; Mon, 21 Jan 2019 07:47:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN4OTV+X/B+rneb6Be6uliyLodUC3iLbV5YCl+B1j3G8cXshBNYIi0mIPTSICIdU9aHCLVvq X-Received: by 2002:a17:902:20c6:: with SMTP id v6mr30877446plg.156.1548085658003; Mon, 21 Jan 2019 07:47:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548085657; cv=none; d=google.com; s=arc-20160816; b=Xw+CjMVxCfZK6g66y6l8UZ5eDUfvblg9mVsPF4KAnq1XSSiahcpMmT7VpsqQQmFq2G T13sr5yvJ4Q4WxKNTvf9wZboAmt4IZNpULVwVQJdTZuVauudVV9IzPRAVN5yv/0SCZFe BZf3PYfZJDpUQJxF/m7EKwCJoIAhqcKbloazygW5IvwFN9Mo+IX8zUba+IT3h4H4epqz LeSJyGkdArPfBOwwwTToQEu13A+njJZLVctqPhsag6tZ6KGmoO5tse5kOYCcZum8891e ji/HwFytUcK8K3bzUIAEGOlEJ2J1+ErqsAT5rOlrF40I8pypNHcjOtAG7ikgCBUCN2Zl J0zg== 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=AZNoT8xblhcHLvo3fRw/WKumAtS1E6x/TRmCMDcysEGfccDG7jr3+KR5H1ghq17pB3 LE9yNmd6/gjLCHYzNShr64CnHxNvM1YSitRfu/a+BGjoX7YuqpMuNrp2QQey6H+EpigV H3dK3/LnZqJuRASKQZgaSqaie89K/HmsyQ2BWK5wnVithSsKDByFC0NBYZ63wpqS0QJE EWqHzCNtMOt3Hn2El9FWLJZdGiLDNHQwx+/zJkPK85eB2mA5kt59fSQGOURu546mlqIc iR/0F3w7HJXoivkr825lsoyWCg/N3vUZNHs2GpXw4awDaaeHqpGh+aOu4WmPE5QRgX3a FIww== 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-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 m30si13041322pff.158.2019.01.21.07.47.18; Mon, 21 Jan 2019 07:47:37 -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="aa1WM//w"; 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 S1730481AbfAUPpf (ORCPT + 99 others); Mon, 21 Jan 2019 10:45:35 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38070 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730457AbfAUPpe (ORCPT ); Mon, 21 Jan 2019 10:45:34 -0500 Received: by mail-wm1-f67.google.com with SMTP id m22so11310796wml.3 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=frr8hLtiyNSc1u+0pGjKiJmMkg/9Ldhr/XfEcndkBur2sAIOJiDSWN8TXAOdfB6Biw WSbcgBjRzM5WF/yYVqjnOWzierlt/RJX5f6fuDzXI/EXO1ZJ6fXM5kztgoKQH1uceB2D ufq+AmWLKT9mgH/kMTVlvLDPyfIppohak/rzmtCmb6eTM3bP4WtDG8RE3uUB+B/AAIgr 3oaPxAGqgEBl3IWavkpme0nJMCWAL4vmd2xBbELP8FFgk3HXKRXtDXaK8Wa56oeiMZex Z0A5287ngZ0K5jqqTCoNOlBo3gN4gqwkSCqS7ZXVnQa4MiMGSplldMlHRGpEwxJ2Vd3K CLXA== X-Gm-Message-State: AJcUukcGip2yEZf1lI+wGntF0VyCLi0qm7WHVBnTc0Ds+m6WBpIow0Hn 6e5xxQpf5iqikLKmGDlo0p0sUwr8y7U= 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-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/qoriq-cpufreq.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) 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, }; -- 2.17.1