Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6370581imu; Mon, 21 Jan 2019 07:47:44 -0800 (PST) X-Google-Smtp-Source: ALg8bN6JLazni+5Yv1E1ibxVQVlo9y5PtMTfeCbXXZyl4k3ug1a1vtEOWahOE/vZSMrw8N1wAAN1 X-Received: by 2002:a17:902:8c91:: with SMTP id t17mr29737762plo.119.1548085664217; Mon, 21 Jan 2019 07:47:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548085664; cv=none; d=google.com; s=arc-20160816; b=tHc6xY8aUXYHNnOQE+Du3YjDzeYuddlkt9iTRRYYFjYowStKIQ+jMJXxW2bngA/0kJ jux/eHQ6s1AdkSG1wPKYPXvxf2ubCRD+kIdzObR3J/EJ6y3aarEieY0BM7wLa0g/1L1+ wKTpcmuJt4KvB2mqXby/V73bNosknZzpD5pgJbZP9VDyft9b+cdA55WxHyCxYsEeMTnj Ww2z8aHyACcEdalH5xzMIEAljyhpKameX4zW6DUYhbL1LXCEdF3NPD5is9yQDVELhKfM 6v71KhhkRUsbKDK4fSuP5hUbtYdeiK0ZP1VKb44IMUevz2EmMQ1hg+VtWkAhYORsD3YM S2/w== 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=T63OtBb5d/SyfS18z9EP9kCE+nbSaEo523ZmM6rZQLgT6Pw2r5tK1Tw7P0xAVz92q5 GqeLWKnv/6MSsgycKL8nrWZBcO+VhqDzCrUmw6nSMR/eHH82/gpU30BzYeauWqEag/f7 7MCf5v7IbXDpl9lYT+ms75o8cS2zpLXhRRtINuns0TcvjHKvF6XINd7xNSJy+osV9JVn K6U4lt7jyqnAVOpITCfgfljtWsaJZIQBlODBWN7nFJONdWDIRua8WWGL8Fm5GLg4uMfq msIDcQKMRr05g4IO6tx/SVnEa6IjRFaJJyWv/pWgPHAr3Ps7qJFTkd1qDPJiWXzhDVz5 M+7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UYm41OgY; 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 z2si8293909pgs.267.2019.01.21.07.47.28; Mon, 21 Jan 2019 07:47:44 -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=UYm41OgY; 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 S1730457AbfAUPp7 (ORCPT + 99 others); Mon, 21 Jan 2019 10:45:59 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:34215 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729676AbfAUPp6 (ORCPT ); Mon, 21 Jan 2019 10:45:58 -0500 Received: by mail-wr1-f68.google.com with SMTP id j2so24012745wrw.1 for ; Mon, 21 Jan 2019 07:45:57 -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=UYm41OgYi5vribcT/yRgVmTyOKfonDp1gCSdYoN5JVhxHQmtv7NPmG0xORTgY7t3pS T/H16ms5FnaubeVeQ/LqMlVCQyiGAXxiRrCooF7w9UuIa95pNlZAADkVBU6OMzCwfbPW Q82riebXP2V8q6m/jnTlG9XdykRzGvtKsBwIg= 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=PZ9NR4MZ+GR49kgrEMqfRnQt9diESXNenT/sa91jTrg7ITCRB86SQExM4oh5s53NXg mCh405E92qdxSsFJRthZwg2dy4io1AZKVTKsCsNggZ1GeLSNVwquxaxUfGgeno4BKswU NSAqFnMbMg7QxyPGDAAeQR/yiLtc3Vvod+6ok1uYniKnNOy2lwdw2Nhn21mdxFQ3E0dQ IBt58RFyCySTsQTcZz7QthNwE/bfRpier0KLAAdj6owTKKfrLcS7qRlT2/203ADZdHHs gnpQCNJuYnahxSyQICXeRFlM4h641Rd2CdlB8pbwRq+hNeswct7QYJQkJa9QYNzECOeP p9Cw== X-Gm-Message-State: AJcUukfJUQVnLE/P27GI4d6YcWrKOALMIfbT3G8vlslXhdVZiYRxTFW2 arTTcBPhl7zkyId/GIR0rCMJ2K1j0us= X-Received: by 2002:adf:d243:: with SMTP id o3mr29691751wri.66.1548085556785; Mon, 21 Jan 2019 07:45:56 -0800 (PST) Received: from localhost ([49.248.61.1]) by smtp.gmail.com with ESMTPSA id g188sm64972795wmf.32.2019.01.21.07.45.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 21 Jan 2019 07:45:56 -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" , Wei Yongjun , linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH v2 8/9] cpufreq: scmi: Use auto-registration of thermal cooling device Date: Mon, 21 Jan 2019 21:10:33 +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