Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3142417imu; Sun, 27 Jan 2019 22:47:25 -0800 (PST) X-Google-Smtp-Source: ALg8bN4SPbPK0mOo4Zg6A1JjI07rxm8a/Zh7+VaAAEbICZMxDHOq3AM68OUVdkqg5Dh+7jy76cFN X-Received: by 2002:a62:3c1:: with SMTP id 184mr20965837pfd.56.1548658045156; Sun, 27 Jan 2019 22:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548658045; cv=none; d=google.com; s=arc-20160816; b=shjaM4D4u7D3vjlKp+zExmoWl+DcXMYhc60yco3BgXYL3G2f9sMlhItuUqBT+FH521 /tpawxj3nP2lNVpTyChPKpw8qaWLAInrrP26yf/z9Knp/jKsekoSxl2r+/t7gdOcgZiR ZWbgebtSka4AhJElistnjsaolQ1TZtLBh7/hf4SjRcIEfGibKGk4dzTwbIykKqu3DK9m RaLLDRGQQLpYUGEmMhJRo27OyTMz0YohL3+ne58EObNZ/DSLB9od9GguCDd2pq6FXRhC p6qQBYs7DETLA6/DkFvmnv/LYUe5bGnQEOa2e9ph+vAKPzUGGCnOuQ56x1c9LknIhzQS fCow== 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=lmDIKADatw1oUeQ5UHUMSZddpdBoEMSbYiY1RQRpnEA=; b=mYZZFOAq/sKirkM6VztHe91ud5RET8ipTUaWely8lHLHqDpCBDsnJyr/PRcZhnkMHF fhi882X+cvmnaFUvrpzCddXk6JMLUgEdlNzxR77wM47C5wdSQL4VaHDIIiTSe0W9fcaL xR3If6cmiESNeWyvKknsXIsV0+PZK+iRkM1PG4fboOfey3ARSYnMViTqQ38odhuqgY/5 qlbYVfGwQrJzurVTvMTTUPv3C1pUmRUKhOBVjYiLJBcUEzhfPsMX+s+5T8KkaZXWs4Ni uv5GlL2aEOJ7r0Ps7oyTN99KYgE4Qr/jROMQz7gHdtc1kQ5rH6D/sPToJjZSDlUk1aqv Rreg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ONUvgNzN; 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 r59si35098489plb.247.2019.01.27.22.47.10; Sun, 27 Jan 2019 22:47:25 -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=ONUvgNzN; 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 S1726779AbfA1Gqz (ORCPT + 99 others); Mon, 28 Jan 2019 01:46:55 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:35193 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726648AbfA1Gqz (ORCPT ); Mon, 28 Jan 2019 01:46:55 -0500 Received: by mail-wm1-f66.google.com with SMTP id t200so12661004wmt.0 for ; Sun, 27 Jan 2019 22:46:54 -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=lmDIKADatw1oUeQ5UHUMSZddpdBoEMSbYiY1RQRpnEA=; b=ONUvgNzNgC8g3iZPKMxdM8Gx1l/rUdqraqCco0IlE7riwGoAF0KYN3xomg9e4bRUbc HrWCxAbbr1zI0fmM5bLxSSgRUC6DF35LLtHeDyu7OFOpNczyaJ+/k/FusKHXx77SZQB7 w/TyXnnGQDgbgQSAPvzpl4DTEkTgxXwYMKnMk= 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=lmDIKADatw1oUeQ5UHUMSZddpdBoEMSbYiY1RQRpnEA=; b=J0fhUfMszq/i1IOqUudrOwEPA2e1zpx/fIcZanFYVLpNfIRW/4StTBtNvDZSTniUZz D8+qCfyhcEvwuNqKJxbG0duxekEWIpOlbGd/Y2t7xOKmr+yyFYb/O9t5CNhRZ7uFw0FN hegg+AprFOIqIaXuN8Iry5uxFn7ikhYBK2yMzvP1xKwRCBieFoTYokDHvHkN446WUYBK RCcE5oJ/nC20YdnPBWeps01Zc1zInC/V0MzFp+iuGu6sUqIU1vkAMrYjULLaEXme3flh Z+jsxP8IS0ocSMgdTn4PNbD/Tqik6gmO41W0f55qZMdBwyfm2PoKHDJ0sfOF/npGR5sh 6CoQ== X-Gm-Message-State: AJcUukdqNuo0Jro+oFrm+ViwHjE2Wyzahc8ur2m93DY7Eya5QGEkrFoZ 7elnd1Rt1LD1stvMi2eauRkowfmoZUs= X-Received: by 2002:a1c:cbcb:: with SMTP id b194mr14651461wmg.64.1548658013127; Sun, 27 Jan 2019 22:46:53 -0800 (PST) Received: from localhost ([49.248.191.44]) by smtp.gmail.com with ESMTPSA id n5sm112413370wrr.94.2019.01.27.22.46.51 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Jan 2019 22:46:52 -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 v4 9/9] cpufreq: scpi: Use auto-registration of thermal cooling device Date: Mon, 28 Jan 2019 12:11:34 +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 Acked-by: Sudeep Holla --- drivers/cpufreq/scpi-cpufreq.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 99449738faa4..82420e8e5f0d 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -34,7 +33,6 @@ struct scpi_data { struct clk *clk; struct device *cpu_dev; - struct thermal_cooling_device *cdev; }; static struct scpi_ops *scpi_ops; @@ -186,7 +184,6 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) { struct scpi_data *priv = policy->driver_data; - cpufreq_cooling_unregister(priv->cdev); clk_put(priv->clk); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); kfree(priv); @@ -195,23 +192,16 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) return 0; } -static void scpi_cpufreq_ready(struct cpufreq_policy *policy) -{ - struct scpi_data *priv = policy->driver_data; - - priv->cdev = of_cpufreq_cooling_register(policy); -} - static struct cpufreq_driver scpi_cpufreq_driver = { .name = "scpi-cpufreq", .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, .get = scpi_cpufreq_get_rate, .init = scpi_cpufreq_init, .exit = scpi_cpufreq_exit, - .ready = scpi_cpufreq_ready, .target_index = scpi_cpufreq_set_target, }; -- 2.17.1