From patchwork Mon Jan 14 16:35:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 155560 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3864981jaa; Mon, 14 Jan 2019 08:43:32 -0800 (PST) X-Google-Smtp-Source: ALg8bN70klPpXglFWbVKkx5VVobKX4+ftlcvqPK2YnNQUBtVwZ7tGO5rIyKxcwx2zIOCnRL8FKGy X-Received: by 2002:a63:61c8:: with SMTP id v191mr23866979pgb.242.1547484212358; Mon, 14 Jan 2019 08:43:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484212; cv=none; d=google.com; s=arc-20160816; b=H3mSjuG4UVxNtRb8B/636sRWKBqWNzZ50Mw91J+7/HrCzGVfOnf1nVRh5aaHMEawTr Me6ZDjbx1H4sUUJgG1nUBko6od0tnnuonR9f1Iq76JvchkqTg/7GGSgw7w465VSuUYks f6IKkA/GXXQzkdzwFVfLkHnGGI+mzGbAgbP9GewGD2fxfcX7MrGNE/BGYEhdHUGYjG5B g200rMRs8Fq1xxZrwc2MpO+zy+EU1J5fRRMFVQvJBGZIiQmlQqWg/g4e4y/4bpRCK0Hu HLcPNUfWNSeLW5d+7b+j96ILyBwDSgh5phwFIUWZ97Ho/srWldR+RXMPVel+qiQoVZW9 1ILw== 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=8jUWUXinqrIEk2wbCrHnyISvXX2O3vcX46RGBCRFza8=; b=i679NcoCpEHNrvjsvo4TFIsa7XbihX7KP9pEg+hSdEewViAybNYDw5ZNCPmoj3HWIW soop8QZz3WensYHk9EpyoWl+T8+T7gFUv8fjeDdJJ2DB6dzlXwre2IJ8VsaDacdwIPjR ACY7TjK2cukWXEZN7bnposY8e7Kv6Qu2TWe++PKo2AiOhuwjgQ10j2JT8l5tEq+beCbo njD8d35DlejqoyimKtLmMi7giTu8c4eigGDrK0NuMHbb1qxPPx74iyT5NwOT0ba+WgdO /m6mqqL6VMwoIElphgW8uDGqwC0+Wi2i4Vr0x3+eShBF2g097q7oLf4z9z9hIPQ4lEoi emCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CZRSEX9x; 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 c13si682044pgi.531.2019.01.14.08.43.32; Mon, 14 Jan 2019 08:43:32 -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=CZRSEX9x; 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 S1726786AbfANQnb (ORCPT + 11 others); Mon, 14 Jan 2019 11:43:31 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:40561 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbfANQna (ORCPT ); Mon, 14 Jan 2019 11:43:30 -0500 Received: by mail-wr1-f65.google.com with SMTP id p4so23672543wrt.7 for ; Mon, 14 Jan 2019 08:43:29 -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=8jUWUXinqrIEk2wbCrHnyISvXX2O3vcX46RGBCRFza8=; b=CZRSEX9xhalKjgqG4U+P2MSdMyDo7y7Xr/ytxGZM78A+F/9DrRIo/KhQWHyj5c1d9U i7GpifF0VdNNm1c/Ky6ueBZzsUWSqv1swnoeLzzbJJIe6CwwmAHNO2t6g0/JRxI3QeEk 0VHkhylq59Tre+6qsnnEjgjbSOedrDEZjKMFM= 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=8jUWUXinqrIEk2wbCrHnyISvXX2O3vcX46RGBCRFza8=; b=ZBoeonYm8B/2dDfWyoDiR+QY64EPjSW/DJuG0Q89rtSruqfqjAufslT46Xg4PWK5mW Y5DJuaQNOblw519LfcjbtxLvoZAg9taGgy68hUTiMGSuhvm+RbI1QCyNF01Dv3DKuTyc dpmfsJB3WDLiHprsfn8lnsHzcFSJM7qnZabxYAv30vKxDrTjJaVxes8Aqb1naW83G9g4 C+emTtWpzkdJ7ob+4FfXbWXALnITW5tA9SoHkqZK76HgzTYsD1j+Vt15aCnLPaM5h9dk DrnxJU83YpT0igqv6NZFOdKkVZVj9z4AvpEGBhqPm5MLEYFz5ojt/V9ivg2vLr//kYyS xiqg== X-Gm-Message-State: AJcUukfldi3vG/xQvsAAdSN3QFO6qWlcCX4rcir9Su7YLuaL/vtkXlc+ xM30RycTqsCJx7TLTxa3jxRm4w== X-Received: by 2002:adf:80cf:: with SMTP id 73mr25037001wrl.57.1547484208974; Mon, 14 Jan 2019 08:43:28 -0800 (PST) Received: from localhost ([49.248.190.171]) by smtp.gmail.com with ESMTPSA id f10sm7842762wmb.35.2019.01.14.08.43.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Jan 2019 08:43:28 -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 10/10] cpufreq: scpi: Use auto-registration of thermal cooling device Date: Mon, 14 Jan 2019 22:05:02 +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/scpi-cpufreq.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) -- 2.17.1 diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 87a98ec77773..c01c63a342c9 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, };