Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3142342imu; Sun, 27 Jan 2019 22:47:18 -0800 (PST) X-Google-Smtp-Source: ALg8bN6ibalcf6522SBv7+i4+YcDWI4XoS9KrCGurlIP3tsb8+zgoAzEarEGVps0Tokg+69VFS7P X-Received: by 2002:a63:5b48:: with SMTP id l8mr18874545pgm.80.1548658037971; Sun, 27 Jan 2019 22:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548658037; cv=none; d=google.com; s=arc-20160816; b=cD+FxgMZ+EuXXVBeQIZ5zspSI/vOqGp+ud7Al9TN5Dtz3p2BnALUJpaZ+T9kRKmYct rY8kzVnMO/eT1/XBNTGQGAPusHocEYlc94DAcxDTBXv3/3MIoLpA7SnrcLog5a9ZS3Tn yUaz3ROh9J7ca6SrUxV7nqUa/In/7ym8oDuI9DUOlHP5ABbs8koNW8qbila0eQg/b5pg As7d8yTnj8+/TKa5jKagdiHkptEJxbkFCaEEYRCi17q9115tqM2Bz9nn14Iq4lW4ppeW fC0zr+ksXsTWYfTL3XaYWBRUMlyXNIb8Xc0k7u9htDt7PkLJxrRY886QyBGODL2YdEHL 0qBw== 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=GmDnlLpVgma8uTBtY4MZFOxf4814+kuMMGmTHy29MYNdz3mPCINcuc0UmAVzvmPYDs tzGrZP6Jn1dq9XZMgDc8Y1bLkXtU/fSxAUW+dt0CweyigvYakvFBQLW4HyE9bBXaALDG vgXc0QSiSum/z7hWym7d+FL95lPSy0ncX6mYkmeHxkJvwGlcoBDJtfjEPxUX+cEt8vWA oXG/yuFI73FMZKcIYSkaTlI9EPKptfQ4JzuWU8LQ903C/9qY+hiTBtb8LDKZ94psGie5 l1b4tqxdVuerSs+PFGA5TM/iu+0WY6fnBwwHrZT6zj6ThYvC9hBjg4eXIxAjBPoPmQXH RqjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HUk3Secd; 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 q5si28577284pgg.204.2019.01.27.22.47.02; Sun, 27 Jan 2019 22:47:17 -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=HUk3Secd; 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 S1726719AbfA1Gqd (ORCPT + 99 others); Mon, 28 Jan 2019 01:46:33 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40556 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726661AbfA1Gqc (ORCPT ); Mon, 28 Jan 2019 01:46:32 -0500 Received: by mail-wr1-f67.google.com with SMTP id p4so16698777wrt.7 for ; Sun, 27 Jan 2019 22:46:31 -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=HUk3SecdrvnJ83/Xwlvn4vLndaLEzSF546horDbu3kzayiHpAMhQUxQh8YokSO51GK 7zRXduNluXbueiKMdet2oOnFHJiqcONC2veU8IZoqsZG7m7eRyINj69EzaVuRX15m966 RP07Bw3PXe9tjtUejQGr/ESceHxIkDJ78SA38= 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=Jiz/5aahfvorb03mBto4sbg8jrs34wtcs2VVI112RZu/tOJ9PTYe+upE7lHgb+L/qn onaw1j6Ej6nQg77IlH8kiINnw04b26SLvWDodDbo86ZO8VvgSxAeKNzQRWmawC1b/SD+ 2MNePuRg/TWgvYnxi+8HNRqND8lReKIGBfVxal8IP33sY1Dfr0UU+T4xbCbqx5yXxFEr MsDRE5c1XuCxfE5xaaIhXvY7/9gkj54SWKwreFogFMOOfYH1U/AMXXkv2p5cspyAi8IQ BI3vp/GLvuIpBNudN6V7AejCaxYRSqjvMAfo/YLGsn72Dl8Vop9aN2LhfYb7SQT0X/t6 EvZA== X-Gm-Message-State: AHQUAuYVYE88pWTEXQlBgrSpBnuGXK8/1nhA8Kx4zX74jMngKafGLOYT ot31hpL7cVH1tr+kUi9bOGnSB7zIzp4= X-Received: by 2002:adf:f401:: with SMTP id g1mr15063951wro.103.1548657990362; Sun, 27 Jan 2019 22:46:30 -0800 (PST) Received: from localhost ([49.248.191.44]) by smtp.gmail.com with ESMTPSA id 67sm185539371wra.37.2019.01.27.22.46.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 27 Jan 2019 22:46:29 -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 8/9] cpufreq: scmi: Use auto-registration of thermal cooling device Date: Mon, 28 Jan 2019 12:11:33 +0530 Message-Id: <81d81c0016fb275728b7b604020c22d8f53991b1.1548654899.git.amit.kucheria@linaro.org> 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