Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3770832imu; Mon, 14 Jan 2019 08:44:58 -0800 (PST) X-Google-Smtp-Source: ALg8bN6UGgzv//Of+rxufuZQT84VHeN8DvA3JUCV33t8796hyGmdtrNtYzU57XF6h49RYjjlq1lY X-Received: by 2002:a62:184e:: with SMTP id 75mr25684016pfy.28.1547484298030; Mon, 14 Jan 2019 08:44:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484298; cv=none; d=google.com; s=arc-20160816; b=D88xVLIIWOp7rrA6AbKish4zq/toyPhskfuNHhUKTHcBk5SBbM7AI32Az8lmdthjFP WFR/nLJZiH8AbpPAEksoGXmxbcV8/TR664n2VWVpTABsCioPU30Npff/8BkKff+JZmBI 89snDVt0PWiv1lfLc9NoDmwte0HTj9xIDasgleQa7wE3ojxxfHld+xK8yMfEdeprg+an kRYcTk08iaQVwo9nEfGstglkB6zVr75uInivT8j9YDejW9CiGEh5iV+vdsjthn+DuKxD RJDbyq1AdnY59nd1/Kv0kJiQb2IT4QmYZ5KMyZRrkziy9ZctTUtFbCJHsLvfScAqVoxM HqUA== 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=iuol/fZP053FPCc9MWQpafG2wQ+zkmNVDckUdKA9vwct2wkjmei7xpFnE73jRBvAps 7RXogLF5Q7bqBlzeiXDJQ4eo9PFlkiRytaZPjH78yLUznts4m7hRdLlrvtiQzodY9a1B guB13s4v/3kdIRaI7LsCP63YqNPkoM7Lg32I4JBfVYu2FbYg3RP3dpBef4ntuOvxw2Y/ xu3cio6vx4Ie0r5gJZG/hgV6oS0ZUBcnvFO5sFsRSLTGTmuRu5l7O5ZRMrIykGyCOrnM wXyOh3Pz77rRthGzhrIklzlcwA6DxLzlz4SY03w6Xj28iZVP3Ha7Q7GPV9xHJv9CV8eK dFMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hUR5lnVQ; 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 43si704932plb.176.2019.01.14.08.44.41; Mon, 14 Jan 2019 08:44:58 -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=hUR5lnVQ; 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 S1726858AbfANQml (ORCPT + 99 others); Mon, 14 Jan 2019 11:42:41 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:34244 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726757AbfANQmk (ORCPT ); Mon, 14 Jan 2019 11:42:40 -0500 Received: by mail-wr1-f66.google.com with SMTP id j2so23757778wrw.1 for ; Mon, 14 Jan 2019 08:42:39 -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=hUR5lnVQxUsyQqZ4Em0vpOTZK9O9zFAw0JABe/OkS6Qpz/WFaSndphU2Parq875aPr gs1kgLl0WEYPvYB/8xZBtnZqUkSqFKvjMuXBwn05KtYpaLI30C5Nt2ytaQk+t4kIOCi0 f9tgxnuO7EZX7EmA1UgdESuBqgvbuMFcq86HA= 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=ngXYkRtK2rb9whFgzfk/m/KfW7FNPoTsKe4VVrPpUl4j6SpBKmVX7f8uRibdyNHLg1 zJUAnkZF5cY5peBXOh5VQ6njMejbV7EwwfrSErkHXJlzj/uP4RxHdKr6EFr7Gvx1cSux 5qcLRuBPbZ4RJbE6ICXfO5L9QxoQtlW6asYqbNI1zs1xO1L/+aih03E9rP1Fj4QAYi5N sDBhJpLntr7Zgu5dmQW7f9frJIOlVj+duF8reHdRk0dhLZ2bvjX8YnCmw0+xLT1G0UzL 2oV+e1OAlvglDqtlo6dZf0sWxF8UA1Xq5u/eIYOVbBwqz83USbuBd3VwN9/l4fpdFKPk bZcQ== X-Gm-Message-State: AJcUukfx3p8wQP3ZoSrHzIJAao8dG10dZEfJZlri8+IcrlQ933VPGIBt rV/mgcU5s1TlrkLWZDQAHB6EaydNZhZGVA== X-Received: by 2002:adf:92a4:: with SMTP id 33mr24707627wrn.11.1547484158818; Mon, 14 Jan 2019 08:42:38 -0800 (PST) Received: from localhost ([49.248.190.171]) by smtp.gmail.com with ESMTPSA id h17sm70359262wrt.59.2019.01.14.08.42.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 08:42:38 -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" , Tang Yuantian , linux-pm@vger.kernel.org Subject: [PATCH v1 08/10] cpufreq: qoriq: Use auto-registration of thermal cooling device Date: Mon, 14 Jan 2019 22:05:00 +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/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