Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp142280imu; Thu, 24 Jan 2019 23:06:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN5zssIiLtJzbwloVu77bcropby0i8tGRwLrDvyec/76ai83p41Ftk+CxSlhhu+aFmtvky6b X-Received: by 2002:a17:902:bd0b:: with SMTP id p11mr9861892pls.259.1548399982175; Thu, 24 Jan 2019 23:06:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548399982; cv=none; d=google.com; s=arc-20160816; b=Z3YwTt4ZzHLuDQh9kncSkQdVirpMbc0cTYnqfp6JVOPosT129sUdMfBJgw6V7yagB3 Yonzt69U/1X7uv6jh/InoBwHjAECCVTpSW0orpYEdntOD9YzcBHLZHKBFHravNX1/Cc7 nBOk9VohKZLAjEK8Sinf+FAWIOhFVWvZ7tjLmKIPxzCchB8TTO/PdSCNW/ygj/tetMdr HeYYwWc0JX8OIlBgaPo1cdu1Q7rBNOA/5cQvwco5h4YrUr3ZAzXMtxM7fVPggaKqA6vG 7EjNL0qFN810FZ0dnsKZGdEn5Zj7ssuyAGb9X/Fe++GEDo+BKaVymtPom9BfJkDi7p7Q HbcA== 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=DP7Ifw11K66SJt5evjaY1FWRXnJBVFj4cNuCPURr8NXvJtgkRFRXnlGx8UjlRZ2CdV 8Lxnmu6W7/9aTC9QsgHZPC6BprlNogmPS7o/K8uRFTxnudhv0xVLi+Eo/ioxF7iIX/Xf rFB5x5LFfUNKEN2QHYSselLx/fTxq68BsG3ekqv5gTrzRnjCBPlI4wX3S5K/rheQYsqL 8fvmvNTgsR95wiSihxDXK+wRZDFl61labJZC9GDTbUCp9CtC07owfRhrjDRrRkiOvzju w2uAOZqc1oRmLTfuf2vuncIlsYTPAELyuCulY6VKQyVvAnhFRG3s1aBYjd9pXeb4kiie MsoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mfl4kUgk; 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 l64si11576783pge.168.2019.01.24.23.06.05; Thu, 24 Jan 2019 23:06:22 -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=Mfl4kUgk; 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 S1728554AbfAYHDc (ORCPT + 99 others); Fri, 25 Jan 2019 02:03:32 -0500 Received: from mail-yb1-f194.google.com ([209.85.219.194]:33091 "EHLO mail-yb1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728515AbfAYHDb (ORCPT ); Fri, 25 Jan 2019 02:03:31 -0500 Received: by mail-yb1-f194.google.com with SMTP id m132so1724188ybf.0 for ; Thu, 24 Jan 2019 23:03:30 -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=Mfl4kUgk5Aal9odAJZaf5fVDL4LZALQC7ZfU1MBmIZrUrGFbkU/ZoVR/6wogyLJqT3 nBXoxBHOUyRGxHsVUurXbrSQ8ExPyV3uzHl/p9AqV/3GBDONOntxw0HZOtNYbgx/s40b N4Em4TZXghHpuLI7Wvt/9ucEhVUfN7XsiTGl4= 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=gs0QazKNOz9dULDpszuSqiwjsIZ1EHHeNVxgHd3XFCu95R3HUdqq+avNhUIpXpOpC6 DzwOBfCWrz+yKyN1mzf7yEUTFk9p/7ijV/a1rgx/YL1kt6cHA8OXKCEsPHAMnb5gpBEI fDrYzyXiR+/mNOB8ZFiziW0HyXTQmokEpdFbVoXFki5rOBOYR+lN5QyjLPUf8h29pWY9 8c1duTCYQvUfzHgae5sGSgmWPCcCT+5gQX+F8pGlUkWwlyvWLqY//RBxzuOja0ZOv4ET 5JLqcuaPxtgQttY5GYsQVDMw33WpjzufxjNfB/TYOZXOMfkdYBDRyThv+HZe+GjQf9+5 F3mw== X-Gm-Message-State: AJcUukcseg812uBTDJR5dc9x0IoR7PujyGQn9tfgYTAcwJQ2BLve47NP DJhDaPdVi2bkE5PVHKAlWmkLtION8+8= X-Received: by 2002:a25:d688:: with SMTP id n130mr8188972ybg.29.1548399810240; Thu, 24 Jan 2019 23:03:30 -0800 (PST) Received: from localhost ([49.248.181.51]) by smtp.gmail.com with ESMTPSA id w63sm8943697ywc.46.2019.01.24.23.03.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 23:03:29 -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" , linux-pm@vger.kernel.org (open list:CPU FREQUENCY SCALING FRAMEWORK) Subject: [PATCHv3 7/9] cpufreq: qoriq: Use auto-registration of thermal cooling device Date: Fri, 25 Jan 2019 12:32:27 +0530 Message-Id: <1d18d89fe2fc3655d372a0ab25e1241df4f8dd99.1548398851.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