Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3142375imu; Sun, 27 Jan 2019 22:47:21 -0800 (PST) X-Google-Smtp-Source: ALg8bN7evErnTgHODSnzlQZnTGIhTqi9yh2Qd50nxSCpB+M/4ORLvvj1pd02Kno+yiozOoqqcAZo X-Received: by 2002:a63:4566:: with SMTP id u38mr18652837pgk.4.1548658041829; Sun, 27 Jan 2019 22:47:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548658041; cv=none; d=google.com; s=arc-20160816; b=EwRg1LlU8pWoCRbn1Vxbov8GiZ6Shwyt3Wsa3SrkvHv9D0umnHm4oTWsFiCzM8fPDY pKltFjTLef4x6DiIB3tugN7wapl8n+u9YljcVrxV5bboUH7e+Rel7FPaRZmcfjFxdNIG ycFKv1Gb8zNyo/CuRy2i4uqkva/MeAQP+z+C9iSXh2k8DZVmxGcWWgxU02WRdNSEYkxW M9VYE4/TJq8lZSoa3CCZwzt3sHdh47Rm/hmeDUpthWHd2wW2FileiBBotDEYfaL5KIu0 3G/u5lZxHYKQOj2de+EeN1MBi2ZNUXdcUAzucL8nfGOv6QMpCX/vyrpL2tdkpFTBIpkJ pakg== 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=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=LA/3N/VL/wYkGcW0snaBuwgBGYUAWqo5diZTbStF7+7WhqIolFcIIED63rFLi69hQI yce8R1wpNnCKMbm5IPJMOEetV+Up4V1y9Hxf0hPr3pYBM2HLPBeQX2nlrQrFJNxf21C3 RWG3QqJmCVhz3qhrShTcoEi2hZwleTk+Vw9DiPXSY2KQuj7t8GAFdUJTQtV4zVNT3yxs 4rznQsImKFfGOgPdlVf9M8Sa3t27PEgYkVlIP6mst4YLyNzIZgEOtXo8qUSH0HVg/wuC 2GQCcax6W2AInCc+V1xr/h+pGEeHE9bKMaXFY4Dh4RBYhHyG5tVdWULo9iMP1ofbWekY sCUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ce0p9qg1; 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 p186si30266697pgp.37.2019.01.27.22.47.06; Sun, 27 Jan 2019 22:47:21 -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=ce0p9qg1; 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 S1726862AbfA1GpZ (ORCPT + 99 others); Mon, 28 Jan 2019 01:45:25 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:35053 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726853AbfA1GpY (ORCPT ); Mon, 28 Jan 2019 01:45:24 -0500 Received: by mail-wr1-f66.google.com with SMTP id 96so16728237wrb.2 for ; Sun, 27 Jan 2019 22:45:23 -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=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=ce0p9qg1PNF/g2Mzt+MI/kYGEL51eAZQwxB7uptGywv/lzmD2j+/Xk6ndBMpNS4KLb BgeMs0xQ+O4I+rcGxJFGp/XhLxsOMO8EMccGK+zR497LstD56+kGZnGFeW48qV5hawtT AldDvDhXXBySYabj4WViQD7SKKWHLBn7vR/GA= 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=7flkZLLLMPKnUBob6lG91eyXS2wXjEuVdEl94VSGgUQ=; b=TbSU3uO3q46i0gANY/yib2XXd3ygEHjmdQ5d2Y0DXC7H5+Kumr38y6G28+nLaNGPYY X42H3x6Ku2SipE74UCFeuNqkGlTHtrqE+K0+RzjCTiwxlePdjjyKHoSd5oNnXjZiBCJ9 C/ioS4eDTkA6jyszxY+AlKJrAUD2iznwYt5qPjU3D2+eInSkMJYIax+goSCg9qYZyA95 xw3aMqhl5x65q8X38Ue2NAT0exBaD8KNAIWzWb0Dgk9YXM+JA8th/p1dNGw7pfQqvmgx CUgyFOQRqX5pqjjwez+Q9BBZuWAP4E2ON/qLT6ns6hKF3cFW/cjgJhRfBhNy93FaOChg Ae5Q== X-Gm-Message-State: AJcUukftvf4k7nFPbTmtQo3kEivwKUAMIdfqcb5N9sRgDwQOgTvxsyDH V0Y/mmL7P3ZzqNmYvFidVicox0MNz5U= X-Received: by 2002:a05:6000:1287:: with SMTP id f7mr21262511wrx.302.1548657922646; Sun, 27 Jan 2019 22:45:22 -0800 (PST) Received: from localhost ([49.248.191.44]) by smtp.gmail.com with ESMTPSA id q12sm44198894wmf.2.2019.01.27.22.45.20 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Jan 2019 22:45:22 -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 Subject: [PATCH v4 5/9] cpufreq: cpufreq-dt: Use auto-registration of thermal cooling device Date: Mon, 28 Jan 2019 12:11:30 +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/cpufreq-dt.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c index e58bfcb1169e..2a4c4ea7980b 100644 --- a/drivers/cpufreq/cpufreq-dt.c +++ b/drivers/cpufreq/cpufreq-dt.c @@ -13,7 +13,6 @@ #include #include -#include #include #include #include @@ -30,7 +29,6 @@ struct private_data { struct opp_table *opp_table; struct device *cpu_dev; - struct thermal_cooling_device *cdev; const char *reg_name; bool have_static_opps; }; @@ -301,7 +299,6 @@ static int cpufreq_exit(struct cpufreq_policy *policy) { struct private_data *priv = policy->driver_data; - cpufreq_cooling_unregister(priv->cdev); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); if (priv->have_static_opps) dev_pm_opp_of_cpumask_remove_table(policy->related_cpus); @@ -314,21 +311,14 @@ static int cpufreq_exit(struct cpufreq_policy *policy) return 0; } -static void cpufreq_ready(struct cpufreq_policy *policy) -{ - struct private_data *priv = policy->driver_data; - - priv->cdev = of_cpufreq_cooling_register(policy); -} - static struct cpufreq_driver dt_cpufreq_driver = { - .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK, + .flags = CPUFREQ_STICKY | CPUFREQ_NEED_INITIAL_FREQ_CHECK | + CPUFREQ_AUTO_REGISTER_COOLING_DEV, .verify = cpufreq_generic_frequency_table_verify, .target_index = set_target, .get = cpufreq_generic_get, .init = cpufreq_init, .exit = cpufreq_exit, - .ready = cpufreq_ready, .name = "cpufreq-dt", .attr = cpufreq_dt_attr, .suspend = cpufreq_generic_suspend, -- 2.17.1