From patchwork Mon Jan 14 16:35:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 155558 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3864137jaa; Mon, 14 Jan 2019 08:42:41 -0800 (PST) X-Google-Smtp-Source: ALg8bN6gl6ohzeZpnSf/8wzVTKTgXtmJhywrr9xwPJ+pZ4g6cukfqVsgKs4XGyNM3ZtUKChoHbMj X-Received: by 2002:a62:9683:: with SMTP id s3mr26061909pfk.60.1547484161557; Mon, 14 Jan 2019 08:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484161; cv=none; d=google.com; s=arc-20160816; b=TyAR+iyGs/HI9YUaKkSrJvAYEQL5nt5gpuHaubbpiHhOIkbxCsKq2Y56RJW9a2q9sS +gPqDNWattHXTECIly9rG/v39vpoSdkkeuQW3KpJLziyTigtL7KNq/69Ws+rj8pT6Rwg ZhJDtcFg9hGsJ+Xv8k1/TstMxyqxKxw5dcHIvbCcOCJP2g7pM14I7pmwL7Zax8bYRckK uM4q0wWxMHm9ihOcu8j0XLJyO7u4aYVFaYr+cI9TN4k8QgWHZ+j3wt162TNIKDqN+h9/ NT8GP9TGCUCqTEJRZdmdrFEjiWCD57F1ONjfAWv66HLQizHPhMWTWXnj+y/OTG45gAwI /fhw== 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=eWis/hqFp4xtmF4JLMm/uE9kt9i2e16EndJaVX5oheT9PJaivEwf5Kl5HwOCRGUpA+ qxsuWeIjTs8Kqa++By9x08nmIrlJq3/H2GMA4LyDJeebBWhmN2w+oO20mE77H9IKNdtw 1PTH3/wtxpq/GAwfVa0xJebrXMKA9wFMkpkkZ4IboxkUy5C7KjZR9exOM3wvd5Qs91TD G6TLPtSKM7HOVGaN89WgP90T3j3TbBQGvd6y8B5NKSmQzkILGPmJg/GPG/m9M84R+J/z gSLv+qR233spXPQZ70Q+oQUPISaOy621VGlACNX173IQPshYcxSR4y6vrsSVJSWnKbUG 5izw== 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-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 11si735235pgd.228.2019.01.14.08.42.41; Mon, 14 Jan 2019 08:42:41 -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=hUR5lnVQ; 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 S1726765AbfANQmk (ORCPT + 11 others); Mon, 14 Jan 2019 11:42:40 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:34242 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726696AbfANQmk (ORCPT ); Mon, 14 Jan 2019 11:42:40 -0500 Received: by mail-wr1-f65.google.com with SMTP id j2so23757751wrw.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=rbRVRDa3qu4DweoVsHvm9UBBI/6e50UFKd3Pa+KQEiDYBg27SqrjZRZAHV9w9+fAKE /yJbYwTrkJGXDnm7MGvDk0PBmr9PSvXtfi6UR+UG9rjYtgGaJ/sz8vrNDw2B9kjrLmTN nx8mQXc4XQzP4y75geM4HEdTbyjWsT1Lr2qNN02g3AjzpuHrQLkcaDB2478pC/P/9vgX PN6SqXz1Cg4HjpUcVkq2AVSAGwjTcOo6neqMez7R5Cuv0Yp1w9XiLjwCFTiwrfYZIu/Q kp9r81l4gdPPRVSgb04p9SxXtF36EOA/nwHSqvj4UY7AkUl0UmXT+TAtMSg6RHWQVVsn 748g== X-Gm-Message-State: AJcUukc+qGLfRNKkcVG/TVmsWy2MjM/eyWNDqg1K4nVdJeF39Q4yLuys SKxCQsN1nc5WQfbewhakZ/buXw== 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 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, };