From patchwork Mon Jan 28 06:41:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 156701 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3090102jaa; Sun, 27 Jan 2019 22:45:52 -0800 (PST) X-Google-Smtp-Source: ALg8bN5/3FmATe6+Ha7OYGG/lCbE8nj7BWn/nYMIyi+KENimpVbgPNvjC2sEz0va8te20GHDBOht X-Received: by 2002:a63:5a57:: with SMTP id k23mr18661372pgm.5.1548657952120; Sun, 27 Jan 2019 22:45:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548657952; cv=none; d=google.com; s=arc-20160816; b=E5XD9B6lT2YI0crglCgH19cMpUtoFKm/TB1SNnWbpst09pQ/of9sWab3zXQ+rMMILr ZpGBRsWWZmdBIrYRd7tZEQFk/3fEKAocLZvIX24qNeu1RxatPf5FAqp0zbcOiZVoKQ2+ uYJ/panuLfYxHP5d5/pIF2aNrD9zr0CVXyUE/IBLI8O72NNKx7Ef8eaSViaFIxRHTBkF zRXiX8PES8ggvUhipdQSMIhYX1RsLFLMjcu5d728YUshm55Vvu4jO9aCPNB/jtrQs05r 9FddSSgVcc/m9yr3DkbOabwbsIRKy8YOK8Ha/xuQEsrOdheMI54nLgxj2OjiurBbvFiJ ARTA== 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=cOhKInsZFb0aN7yqYOYW6sIf30ZjHKcWIgfKo8TTVDgn+woajVmd811Fa2V3EL5buy B0QBi1NJsVYectyVlOjpA4/FDtUGDBqG0RCf6eqPbO8ogJpyVNeGRf584PJ1a5Gq698r C48aFrxmjHl8dxDecPyABJ2QTjUYKe6kacVbStCpwN2UtsO7Ftyfjw289p4OfyHBmTrI Pne6wkfoRVGsTIWT9khXg1OqYSTYb/hDXAbNcy6Yz2D/WsuO49O7SSuL7WI14RKww7Ju ni40VFBgCj5Qp2aIdL8aeLo95weiDCoaHj+oG0rf9p4nmR8Dj9MUe6uBiOntG1us82lZ Q0Pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DW4K/5zl"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 c17si6241104pgl.385.2019.01.27.22.45.51; Sun, 27 Jan 2019 22:45:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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="DW4K/5zl"; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726626AbfA1Gpv (ORCPT + 15 others); Mon, 28 Jan 2019 01:45:51 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52800 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfA1Gpu (ORCPT ); Mon, 28 Jan 2019 01:45:50 -0500 Received: by mail-wm1-f68.google.com with SMTP id m1so12687846wml.2 for ; Sun, 27 Jan 2019 22:45:49 -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=DW4K/5zlEo6p1xfdiXC+ynAc8dp2Dfyn0kNB0kyOtEt+Uk9Fl/LFxWlhD5JVjyaY/x V78KHr0qkFAKLjVIzFRlNNeDM7u5RrqTzPeOxlIH0wioS0vBNt1nBMoJZy2ERknd5h+w O38eisMJ4t7VOtaxL09vlB/KIgOCGPLDer9aQ= 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=Nh+LYlX+qeZg1Y/8Kx01f+hsTzbRowFqqcCyZoRM7gqApfvX7Cm13z4uBw5mAu1ar+ tHi4v3DfQ1i+GzwDyz80vTvbfP2r8In8Wl6Scp4pXtJsDkNdOSf9OHx8zQPW6WxqxeWg unbS0+hM0PzBSQZTFH47fMnS+4yWwHjDU2gTNAqrB9TaZPfHZ2jEdGxzXUnS0oyeo8fJ oCiHNIOL0sth2utDF4DYYVdz9KdGPyz2NkaWodRgZkhYCLsACTzU8KH9Z15b8Hreo5/b EB+seCbXKT4rwlvYcjohK5pxHCUG0s9b7DwydZHMITcgsQ8tV9l/LAk/+XhyOm5FJa/m VIHA== X-Gm-Message-State: AJcUukcX9mOrF02EhzVi55SiunOxtvUzEHfHRMbxrkzB3Q2owqxdPbxj HgiVMzlJy7GU4po9cb+Y2gj7eA== X-Received: by 2002:a7b:cf30:: with SMTP id m16mr262294wmg.22.1548657948489; Sun, 27 Jan 2019 22:45:48 -0800 (PST) Received: from localhost ([49.248.191.44]) by smtp.gmail.com with ESMTPSA id w10sm7927176wmb.1.2019.01.27.22.45.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Jan 2019 22:45:47 -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 v4 7/9] cpufreq: qoriq: Use auto-registration of thermal cooling device Date: Mon, 28 Jan 2019 12:11:32 +0530 Message-Id: X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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(-) -- 2.17.1 Reviewed-by: Daniel Lezcano 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, };