From patchwork Tue Jan 29 04:55:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 156919 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4226260jaa; Mon, 28 Jan 2019 20:58:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN4+dtPNH0pFQHMJv5xQpVQP9z/rbrp1jKv9alRdP265jRHQTIFHZ40zJnsvZQDgVxdUGWqx X-Received: by 2002:a65:47ca:: with SMTP id f10mr16123432pgs.166.1548737907554; Mon, 28 Jan 2019 20:58:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548737907; cv=none; d=google.com; s=arc-20160816; b=mnT6On74ABM1v2v6QL6Lvhgp8XY9MnG+HRsVIKWgwcmOvl7bl3NHJX6/63vbX9xCky CMkLJV2gaUCQV5y8FsG62zi+erv7E/KDoWUgSLgSp9aROGjXEm/RevmTA2jlhR/sVO6F U0nn5+NLWRn9FE77EBBzC2Uf0ZwYBbxUw74aKWhLPw2N65P2rTXYoMNJ927vtV+iiy63 y+SafT0eQ3VV7z/BSKIYtFykLT3bxCo8lLU3wEZ0SYvFEjQNWNNBmyaLDdIlPssvPyAh IAcTQGnzeM4aw+XmfuQcfEbpUoIJ6AneTQzGkYUJsxEyjqZEC1YB9Ps6gGwsfsBXOPAJ LbiQ== 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=l5jEfutaw0gwpPVDHGUPHj5GB9c2BDmfuxGAmeH9M7o=; b=UWgCbvnl4k0hA7qWs82Sc7uIr/vuhYrpIjv5gQv4On6FN8naVBB4Gr/TqYAYiVQ3v9 f4D6Q6f2WiRCl+bvii/oyYEef91wkWPNnwno5dlnwlSoUKywKMPYJA0VV2RAarTwt50k ngK1V0tSKLOrvpXzB0SG1V3metcq96IZr0QaMPD92eVl+yC2cpC9wPR7waWK32RG22fP unHSRZDaD3xJODtzeaEN/w4J0qWyT+bSxA76/Mcdbd4+4M8W+dCRVjcj9bx4Zgc87zkV ikhdE3zMSVUzlPn6Ac4ODtuCOwaTidv0fTC86+h0rW5vr0B/toSwQDNLTclnHAFKSnJw oLsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dQXJLEAi; 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 h16si3552949pgj.203.2019.01.28.20.58.27; Mon, 28 Jan 2019 20:58:27 -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=dQXJLEAi; 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 S1727253AbfA2E60 (ORCPT + 11 others); Mon, 28 Jan 2019 23:58:26 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:33914 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727276AbfA2E60 (ORCPT ); Mon, 28 Jan 2019 23:58:26 -0500 Received: by mail-wm1-f65.google.com with SMTP id y185so12022827wmd.1 for ; Mon, 28 Jan 2019 20:58:25 -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=l5jEfutaw0gwpPVDHGUPHj5GB9c2BDmfuxGAmeH9M7o=; b=dQXJLEAixZwDW8vnfsMujaz38Qi7FLMZzL8bgTPloe3dBBSIUcTbx42U1Iv/a9UhAO pfoo7bikilHw9yjxNLQpLVnSusJkqlaGiuapK19uUyJ5oEUuSgj3MkihYfY4xspaNMsR xdgJRQvr+8agBrmQWAaPOtY5uaua6LxsenkTc= 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=l5jEfutaw0gwpPVDHGUPHj5GB9c2BDmfuxGAmeH9M7o=; b=AzIuRupd+xnL6snsJYglYkrGSahRRM7F+iqk5CvfIvlj6sRFzIIvvySl3TD4FdHBa+ hMTm2vqdPgPYn7MgS9Kutx5/+ee2AnbLRCf/gVNjeLJ2S8yg+HTqO2O5gldQZc7Mi3m9 Hq9lTQUsiLQDEbTxOVtzUOhLV+dxqg3unJ7Fk4oQZlVRW9734kdSLTi7nzPQfiq1tqRe PHsanck0HaUIK9jVWaRPuXjLe4Xahmguv2niv/uR1J+SG3p+9xAKUlTr9z3feB36L+Iu kvwmbMD0yKIKTrKretbrmYul7SHKhMfJi8wyV8SHEwAZbZIzeCsxlHlTh/YT0spoWdr4 LZpQ== X-Gm-Message-State: AJcUukfMEbcTxKl1KGZEAskpxYt/tsd5NWNLRbFp8i95tviR3Ga6P9CS +N2Y31fcYcY+FwLfDHzasb7how== X-Received: by 2002:a1c:f518:: with SMTP id t24mr4101747wmh.26.1548737904717; Mon, 28 Jan 2019 20:58:24 -0800 (PST) Received: from localhost ([49.248.171.30]) by smtp.gmail.com with ESMTPSA id n127sm1727856wmd.20.2019.01.28.20.58.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 20:58:23 -0800 (PST) From: Amit Kucheria To: linux-kernel@vger.kernel.org Cc: "Rafael J. Wysocki" , Viresh Kumar , Daniel Lezcano , Markus Elfring , linux-pm@vger.kernel.org Subject: [PATCH v5 7/9] cpufreq: qoriq: Use auto-registration of thermal cooling device Date: Tue, 29 Jan 2019 10:25:13 +0530 Message-Id: <3c0f9702f2d68f684b16c4ab5dbb3222d64127e7.1548737236.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_IS_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: Viresh Kumar Reviewed-by: Daniel Lezcano --- 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..4295e5476264 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_IS_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, };