Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp142585imu; Thu, 24 Jan 2019 23:06:47 -0800 (PST) X-Google-Smtp-Source: ALg8bN77Wg/xOA2CYbN6GcibEbRMeooQ6TsEs+feyLuuTGqZP9cnm+QDU9G+VWJxea10MfaI2XVf X-Received: by 2002:a63:554b:: with SMTP id f11mr9163311pgm.37.1548400007869; Thu, 24 Jan 2019 23:06:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548400007; cv=none; d=google.com; s=arc-20160816; b=ZLX26qbvAHZE8p8n188O4zSZvPtb94wbdXPNGGWbTYv2C/CirKWL/OWKCEEkL+iQXI hMOXTmrwboWRY5hOWdjfdJVbe1Sm3u01zH9d+pa+o1qDcWR8MFqVJjtnkPx+Mg0V0nNV 55xYqjTrvS3VZSxefNi77NfrXUnnjURcMWfJOpoh7UUYLCDeG4Bg2XHE1OinoTP/AUmN itk4No43tmITz1XXolINXQpU+DJD50CeqUPPMfgUDqujJv6nLHasVUpyvWxuOLt6n65O l8G4jK9VjBmeLSaTU986sM/2B0eBYp7cCggZTRkrOpkIz1sW0N35X3hSaK29zhYaeSHW bBOA== 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=xA//1FlkdsXmsx5auTFeNL+jjZLqfN7vDldrYpONvm4=; b=bW2gwR+gQSrq7p6f0A/PhGE1snRdCrNWOjMkqbcJuo7zWVlu1xsVCrcV7kc+ZlsMQC SJawj7wlF1ovSoD0bYOjlu6msPLRLlC0eQMn696VtYKQItjYMsYUNnXkNTw+T8A6Dj/R tjk9ljEk0HEWethou/Wwo0qhgk4etQ8YIJvM6rLD8HZ9b2DTva6JUneOe0+aLXC/yKbO CY7+ZAW6GauEyxBrq10OHUJt5D4jBITXi/pc08onYfNMfujIMN029smKFkO57RkI0VXd 1nCthqonN/VjdCWuaAVelIgjpJ286YBsK3rwyvWQf0f2F4O5O6BCNtTpm7ofEMHXpYDe ZAqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cKCXamQs; 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 j91si25392613pld.395.2019.01.24.23.06.31; Thu, 24 Jan 2019 23:06:47 -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=cKCXamQs; 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 S1728677AbfAYHEM (ORCPT + 99 others); Fri, 25 Jan 2019 02:04:12 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40417 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728588AbfAYHEL (ORCPT ); Fri, 25 Jan 2019 02:04:11 -0500 Received: by mail-ed1-f66.google.com with SMTP id g22so6554806edr.7 for ; Thu, 24 Jan 2019 23:04:09 -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=xA//1FlkdsXmsx5auTFeNL+jjZLqfN7vDldrYpONvm4=; b=cKCXamQs27SFMCtXHsaEBtbiosOOItfG+tsJqXFmkDoPmAf2H+e73DJevygpbblnSt GFq4GplluPUoT3mbrGtJ1VHYGObCo8N/odzHXnGIQQ7Q5bx0BLnO7FMcKOk8Th/v5nbm 3jWu22wKm/ypacS7C8rwvGblxK9vpItxXi+Xs= 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=xA//1FlkdsXmsx5auTFeNL+jjZLqfN7vDldrYpONvm4=; b=fhRJesF8/rUqTT5z4PEy2gOAU9ngBKrcrFgFDryInko5Dl+QTOLV0w0MKlRULMN0md z3OyUXJo0p8EksM3IvS9siWOxyYI4+CqJOHEfQhlRnS1qj3zIRDfh1Q58MSvykRLJEEJ +dMfdiIiWZiK58g1/uHd9daahwdhVAENKecIAAkUQcr9q18JQd4TYx+aEkhNfh9KmdnH DzMA/+uRjbcu/n0dkIfbGlQB+OYC8dJSZS2SabNDDxr5IqrlMckHOsCW2qmgA4dWTqOR mjS80i9UQ1LqDWxSEdn/z5l7f36RjQVJHm2hAif5x+GOx8RgVzjzcy4ncgSyf6lrtfmJ xmmw== X-Gm-Message-State: AJcUukcza0xfGcnn/cgdO+wboxN9HA/Guxh5F57+1FIWdnrRUEMsNSg5 NNiLNnoPsrv8DaM0xXFil6zNOomS2pw= X-Received: by 2002:aa7:c55a:: with SMTP id s26mr9551675edr.132.1548399848614; Thu, 24 Jan 2019 23:04:08 -0800 (PST) Received: from localhost ([49.248.181.51]) by smtp.gmail.com with ESMTPSA id w56sm11734113edb.72.2019.01.24.23.04.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 23:04:08 -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 (open list:CPU FREQUENCY SCALING FRAMEWORK) Subject: [PATCHv3 8/9] cpufreq: scmi: Use auto-registration of thermal cooling device Date: Fri, 25 Jan 2019 12:32:28 +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/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 242c3370544e..b19e9d129f8f 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_remove_all_dynamic(priv->cpu_dev); @@ -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