Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6370441imu; Mon, 21 Jan 2019 07:47:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN44u4pgYhzroG6TYAjJsz2XVayXxHSoxl8m4gsxKHef94yw0WQn30JN17oD1zPKYKDObTjG X-Received: by 2002:a63:dc0c:: with SMTP id s12mr28888143pgg.398.1548085654301; Mon, 21 Jan 2019 07:47:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548085654; cv=none; d=google.com; s=arc-20160816; b=oVJz+z1SktBTosM8LTeSQxyMN7JbaUblymMz4wn8XzdVxzqOoc17KTNgNz9zEcGW3P kdAsI9o8QWXEJ3457uqwYyGMePk9mdLzR/anIKL9630kl1Rx0bDnGqgjDHSy8VDxOMvm R5gbsyUHoIELtys56spuFWPgsZeZeMVGbKRcJd7GTwNhwQu+BkhMfrRqD0fBlRfv20d8 dKXetGbyNJT6XhqBPAmTEwaPeTywjt+gJ+WTSKByl+IekkP26nD/ExY84TDq/9pgwK58 /fAfEmh/3f6ku1qHlLtY8OMlfVySwUjoI/Av4pqg8z+fI2JiP/cmcJbrBPyrT6Ypb/1s MnYg== 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=P+FulnZJFB5AJJkDRDMmC+IJuWIj4zGdO87ygsSUL6vzpNoGDwY1Zg1vkCFbJFu7rK ZtDwiqs94iguEAUfUeoJ2SZiUgR+oSCtP12XhuHbvrVMISlfVz2y87AjHfnsIcuYhqVA rca98yJGAP2s281vKF+y+H7bgON7OVNFWr66z7n4sAmaOXGmnuaaKjHajoOOsaLH/EHL 5MSVbkzUIWGXv1tsp1a0kc+6Vm0ShfSZKa3YSY/ra4dRFqcHBFTn61UB3kugSniLCE3o +p3IZEGTSNvvlbQTbvdHwHexMC5cIaDomgvdcq+DC/YrY5nLxZZbS7d3vcQVWoRgWVvn zZqw== 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-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 j13si12778596pgi.227.2019.01.21.07.47.19; Mon, 21 Jan 2019 07:47:34 -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=ddUlkaot; 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 S1730399AbfAUPpA (ORCPT + 99 others); Mon, 21 Jan 2019 10:45:00 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41320 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730373AbfAUPpA (ORCPT ); Mon, 21 Jan 2019 10:45:00 -0500 Received: by mail-wr1-f66.google.com with SMTP id x10so23878102wrs.8 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=TngJURtsHUss5NffX+ZzmyPOmUBVRwGMspwGzKCa8Q1l2SzN7+JvGS3/dUVZsy09Yi LUQM8vfcwWQgX9u5/dUy9wDi+bs8jl+IbUMsjl2UmSdB9w2p6HfOGCrubTC5jsoVFvxb sby0FScU8w4M0qvVMw5NVkR3/ofeDK5Yl1b4tr2NaGklrXPs8cMxG6vY4KPj2o6MaTCL h6JbMswBMx4qe5soQ/YXbVfViqCGDXIgRHbOmOjozTxZXfH0HLN5laHAqqJiat5HPiYt faWUZlw6vDead3AWJwDbe0APSjucfWH5seNUWTl7jTg+v4UsmFu/HU6r4lbdMIIakH0l Ltag== X-Gm-Message-State: AJcUukdlKjYUMRayG973SdJxdNorHr0izadol+DDthRoroT5TiU54afq j2+H8NiJBPxmkEq4rEuQVGBPag+J93M= 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-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