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: 10785425 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AE4CA13B5 for ; Tue, 29 Jan 2019 04:58:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9EF7E2B216 for ; Tue, 29 Jan 2019 04:58:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 935BF2B38C; Tue, 29 Jan 2019 04:58:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D5222B216 for ; Tue, 29 Jan 2019 04:58:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727253AbfA2E60 (ORCPT ); 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-Google-Smtp-Source: AHgI3IaAYjS8LolkXBov5RTxAIwY1VhQUzpwri1+MXSjw7e581QTNVwM95h/Vlkfo3OnUFJUaGg45w== 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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, };