From patchwork Mon Jan 21 15:40:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 156215 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp6516868jaa; Mon, 21 Jan 2019 07:45:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN6viBFVA2xXHqbbo3/+6CpirtfKfQ+a5P8Zg6yqT7e9thc9Q0mRNCif5kJxCVm6a/+CU7Lq X-Received: by 2002:a63:2f86:: with SMTP id v128mr27771629pgv.407.1548085501454; Mon, 21 Jan 2019 07:45:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548085501; cv=none; d=google.com; s=arc-20160816; b=g/o+2mHbLH3S+fwaTeetQILP7RVIx5yuE7sVAc+hP4BkWIY7Lq4HqrBHEDUXkgUHbN X7qFEdAAc0iJpvVIdUWaLHZHw5R7Cq/3+P/UFJzmlF29xdzpvVmeSZ+9dnLHWK75U8eu ZPg2DahZpesuONghHkn0TcJnOO4dlVgKT27aP0LKR3UQ6TzMq8U8COvOLAaGbeVJhZVQ aSYy3gXunUoKfBx90J4BlSrHoMzOJb3CfMXqcW+FAnsTukvORAshDu8ZOpU68AT3No/h 1TDrI6T3KSmv0LAvBSFMlhsE+IdwqJzIAlDWc0BWioNKuJ7CPKTyK5w+N6YQHsSLYIjR QkMQ== 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=CVpXec1B/mpPilBp6VNLRpE4YHh63wJx5vBYnNPN8aiFCLOZzPEhF7s+TFgYtj6gC+ muKmFJ59q8c8ITDlDd82pp7tIq1r8sEfrhOwTgpzJ34Qs5eFgc+KKUVKaDQP/f0/xCGp zxGZWKuZlRwmISwfCuaaE7yyt3Ph69LpEGLtM0FKS0pqrDIiWMuoL7SCPcDB+zuHZL8o LX5Yjsb8+i5rU/a/sMDYkqOhZVpoC3N07qa8TSlDiswYeLcmGWwTGn4T4w97eOrg+zd6 /WKiPKGo7IJpXIjn/QDfuxA/2bnLPwgt88JJ9Ga7YvNhmX2V/TKIJt3zaNL5+LsrbQnA pLqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ddUlkaot; 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 c8si12869020pgl.507.2019.01.21.07.45.01; Mon, 21 Jan 2019 07:45:01 -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=ddUlkaot; 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 S1729495AbfAUPpA (ORCPT + 11 others); Mon, 21 Jan 2019 10:45:00 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:45528 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729693AbfAUPpA (ORCPT ); Mon, 21 Jan 2019 10:45:00 -0500 Received: by mail-wr1-f67.google.com with SMTP id t6so23860594wrr.12 for ; Mon, 21 Jan 2019 07:44:59 -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=ddUlkaotAvscldn0MmLEbEqHzkIGbCFbOPH+e2rnlqcruhdW78Lor2TPKnbHQkyTMZ GvAoYrLpzH9BGIynmLGPgbNMQ3oIaybxfU/wKVh1MVqSxQikPDj56p7/33QBn04ERiuZ RKVCit96wOBni6MRofqJHa13XkmdI0W5wYLog= 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=tCxQ58lzzl76u+CAlIcsY+UVD0G/nkOOx9HA/R6VNDQZxqcwnfvKoSXszuMZXUcLsX EB1RYhCkRVlQT+Vnwq9+713OBeDokRodX+GR/pb27GsYD3zItM0XsYaPp0MG4HMa8Se+ Zt5BtfsYfY3ZnkKBONEWEEFNyEnFtY8h0JFbT0VS7wDjT1/ZJ6BfN8kLhp1u86L9keFg fIxOuWVlIPyjgRIaqEx8lN+3b0i4ZeQGesA8LXme5pjez6A66ZJ7XwHMAKOEGflDUTAn F2eRrUB3VNKHkqBQUZWVgPpf6Ko9+ZJ2y+Eu9/hIBtUj87UmSpgNNbEsoQ5yt+BAAf8C z8pQ== X-Gm-Message-State: AJcUukclHP92jAjHITRhoU2IsBkzeAuTsv6fy5egWnvA0n9ZayMHDg3Z wZYP8+XVzLd2TxaXYQu9EFTe4Q== X-Received: by 2002:a05:6000:100f:: with SMTP id a15mr29546048wrx.298.1548085498604; Mon, 21 Jan 2019 07:44:58 -0800 (PST) Received: from localhost ([49.248.61.1]) by smtp.gmail.com with ESMTPSA id t199sm35306565wmt.1.2019.01.21.07.44.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 07:44:58 -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 v2 5/9] cpufreq: cpufreq-dt: Use auto-registration of thermal cooling device Date: Mon, 21 Jan 2019 21:10:30 +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/cpufreq-dt.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.17.1 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,