Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3771086imu; Mon, 14 Jan 2019 08:45:15 -0800 (PST) X-Google-Smtp-Source: ALg8bN423Mmm7X1T0XkPo0d55woAnqjL1OmAJXzjNrQWcX9t6Le+bAWMpPyFmStutKGIN90+PKMo X-Received: by 2002:a62:5c1:: with SMTP id 184mr26035909pff.165.1547484315218; Mon, 14 Jan 2019 08:45:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484315; cv=none; d=google.com; s=arc-20160816; b=zAiR2HuxaS6xC6F4PJI8dhXsI8VvbX74pXhmPGTM5zqiDKoaD9FUk3Y6M/G2KqTCD3 83sF6q32CMz++21UGhkNpic9iT0qM6OKLmACOjfTHw50K4pxt3ciNPF+Lx6L0YGG+g8h wbFKyolCH0bpF7RKbDfDtG5RAJIMCQ5e2Nu9KtAdXgPtavMYHLngMzk3LisWXls3AO9q +BbXvwBcxF5a4+bGFc0esnVLjwZmKMvE8ztKvJyf0Vvz0RLaIqk4XKB2DNIU0KTIK2Sz 8M8D4WYdgy8YeH2rVlIRzBT8mV5E2LHD/P3bc2Qe/dGBKUzGvf/MH89kfPvkLu6oW48Q XFqg== 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=mDodrn+SCjmkCblcpvbM4z/vNhnHCT5BvbpgksmUkgc=; b=ccjKxj+TO0Qx1JRqKX5I5VNogsFFZf69sFnXB1fMQWkJdSfcCj4Jp/CQ/OUyEjUsK/ a8RKoSuX62So1hw8SoSCOiEBu5T/K26GVowNmzc9KJSQUrUmt74RqFY7T7hzNeQLiEjk bIhH5SHeR9qJ3ppUpD+WIZKg4n/HXrhF2jECQ+jZI4EOMMahonVUQ6vel8GUKNTjLJgl eB1nvV8i4gCKxZRmgllaJxPbn4OT2vURfFhI+2SHzef5EZjc0ng6Ikf+P+UcU6tcqE38 iNgg7Hl12Mv4vxvwRTj81iwYnTQaTy7ObRTWWkjaKXwyJdx4yyOp/35jPbsJIlDpcJ8s l7uA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Fhy70gTL; 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 k190si661550pgd.64.2019.01.14.08.44.59; Mon, 14 Jan 2019 08:45:15 -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=Fhy70gTL; 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 S1726852AbfANQnP (ORCPT + 99 others); Mon, 14 Jan 2019 11:43:15 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:45117 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726744AbfANQnO (ORCPT ); Mon, 14 Jan 2019 11:43:14 -0500 Received: by mail-wr1-f67.google.com with SMTP id t6so23603812wrr.12 for ; Mon, 14 Jan 2019 08:43:13 -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=mDodrn+SCjmkCblcpvbM4z/vNhnHCT5BvbpgksmUkgc=; b=Fhy70gTL0OMX9xMLnahPm61C2gyyRa/Xm4VRechtSjnkGyMbcPSkmfRt3cnQNNqQQ7 8fc921xreoiDTRnUNG8vNvQGRtCba0fQmxktSO/vqXw2OhKGxHwXekV7VUmqX6pZRXgW A7SLloAtz9L09a9i5Yvv0XYBV2Ma17qDbQuVQ= 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=mDodrn+SCjmkCblcpvbM4z/vNhnHCT5BvbpgksmUkgc=; b=CJnpraGP0I7mSxorw8h+mziPxDYL/eHcNo4csx49OFVqkNkaJ5ywBuaTVGA7nI/tvn IF2XSPm9vYXImQfk8DOA9KPqz7X5JJk4d9stjWgTY20Z4U7k5Vb832KjB795Ok4Dk8zl oa/eNf8cCSx2zCudFY5yy1SCF/Dsro9Wu/XqyaEo34BqLrNHZumPSpXj/aNQmaTjQLyI p9RRDeCx9uc1ilyRIOqjfPt73PKi3xWyAZcX84dwFRoqJW3OYu3OUtOA5ogIeht7UbbD CA9MREIRbvKX8RgAkCe3cHA5aSypTUEiA5twximl0PPJjAyReSq/oj3o4ORlxbEhCyRk qP+w== X-Gm-Message-State: AJcUukeBvyMmEAzPaY3ihtkZfuQ2Gf99SzuNi5icJZn6PReE06OO/Rip 1vKFtorOglDis1qhL64G0bX2UhI6WsoLNg== X-Received: by 2002:a5d:45d0:: with SMTP id b16mr23989728wrs.86.1547484192218; Mon, 14 Jan 2019 08:43:12 -0800 (PST) Received: from localhost ([49.248.190.171]) by smtp.gmail.com with ESMTPSA id s132sm12237023wmf.28.2019.01.14.08.43.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 08:43:11 -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, Sudeep Holla , "Rafael J. Wysocki" , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH v1 09/10] cpufreq: scmi: Use auto-registration of thermal cooling device Date: Mon, 14 Jan 2019 22:05:01 +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/scmi-cpufreq.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 50b1551ba894..f062a84a1175 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -22,7 +21,6 @@ struct scmi_data { int domain_id; struct device *cpu_dev; - struct thermal_cooling_device *cdev; }; static const struct scmi_handle *handle; @@ -185,7 +183,6 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) { struct scmi_data *priv = policy->driver_data; - cpufreq_cooling_unregister(priv->cdev); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); kfree(priv); dev_pm_opp_cpumask_remove_table(policy->related_cpus); @@ -193,17 +190,11 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) return 0; } -static void scmi_cpufreq_ready(struct cpufreq_policy *policy) -{ - struct scmi_data *priv = policy->driver_data; - - priv->cdev = of_cpufreq_cooling_register(policy); -} - static struct cpufreq_driver scmi_cpufreq_driver = { .name = "scmi", .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | - CPUFREQ_NEED_INITIAL_FREQ_CHECK, + CPUFREQ_NEED_INITIAL_FREQ_CHECK | + CPUFREQ_AUTO_REGISTER_COOLING_DEV, .verify = cpufreq_generic_frequency_table_verify, .attr = cpufreq_generic_attr, .target_index = scmi_cpufreq_set_target, @@ -211,7 +202,6 @@ static struct cpufreq_driver scmi_cpufreq_driver = { .get = scmi_cpufreq_get_rate, .init = scmi_cpufreq_init, .exit = scmi_cpufreq_exit, - .ready = scmi_cpufreq_ready, }; static int scmi_cpufreq_probe(struct scmi_device *sdev) -- 2.17.1