From patchwork Fri Jan 25 07:02:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kucheria X-Patchwork-Id: 156550 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp19211jaa; Thu, 24 Jan 2019 23:04:22 -0800 (PST) X-Google-Smtp-Source: ALg8bN54OmotI2cRSzrwxvAfmp0N9KkvbLms+zzUar1T7jMDr7aJpNNYVBEAfCaP7XoppJ/JXkLd X-Received: by 2002:aa7:8286:: with SMTP id s6mr9596945pfm.63.1548399862633; Thu, 24 Jan 2019 23:04:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548399862; cv=none; d=google.com; s=arc-20160816; b=UFqi1d1pFkb1wDn42YJ23LlH3yFpGkJ9edaeRJIdacNeY0qUeUnJj+XDpGJwhvZlKw 8bw4lrIzu8XdmsEeNcVTsVJzvg8EE9pM9lVbSGv8P5YmP1So9YTshCep35XKx7x2h2ew 3/W6K7xKeLQRl8n6bymvZfMNBgE2fci/P2G/irEYrmNZd6jp4pRyScqvrUVRFB+nxrQi kwJq7JYf55wIF7lkag+9nUloW3ZHShzV/DLiR5KTkb/QlKv0cQfzHm7ybE3ZWz4o0B85 NV37P5Q03gJvy2Wyrffo+kD7BpTwqZk/HANhtpDLTCIoAoLaZ4ZVmFqvy1u7SfdNJFAX 4TPQ== 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=p9bqXlrjUmFRlabFQBPKef5BYw8afZGTddP9vD4UhAmC1SVlZX5Mr6ZbTVOb0lcBss YbD2yyoloklOIch5b+1BYMLB2IFRcV4UZf4rhMKkogeudyx2v77ywhtcyg9K2aUSI2uK waRHT2t7P74USKDDIiaSryoUVFEIMRWao5KmwzAEcNhNplfy4LoAOLVRg3g6mVNYFIhC R1UMgtUO+8YlrYmZzlOiP4hVVOhUUwySHL/i3YFnp/dAXYu+XfQf0nGVLzLxEAgsBDH6 +Bpzutn4sMUvOdnr+Scg49bH5VEeGfFMbAlzbIVbqnS4k8Pyjn+/dDpxoodc+Raqc9VH uUyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c9XfQHXK; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 o19si20154240pfi.261.2019.01.24.23.04.22; Thu, 24 Jan 2019 23:04:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=c9XfQHXK; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1726381AbfAYHEV (ORCPT + 15 others); Fri, 25 Jan 2019 02:04:21 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:41450 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727864AbfAYHEV (ORCPT ); Fri, 25 Jan 2019 02:04:21 -0500 Received: by mail-ed1-f67.google.com with SMTP id a20so6542868edc.8 for ; Thu, 24 Jan 2019 23:04:20 -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=c9XfQHXKTJjH9D8+A9yWRU0POrNIBML8yy4f3PPCCfnJpwyfoCXm+jquPMXGhj78uP v3QMXI6KhuZb5C1BK6jeNEPlGnHiYGwAZUc/Oet7u0C3OjNstLEQ0B6NnDxAPvN9TzNh bVB81EaHQT+ngBa2Tn9F3YVPUF3LOVVXKHEvY= 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=WCU26oKF8d5CL55773NAVRG7GuQed6i68dNmFoEv1XApodyisfcxLcYkLYjOtEm985 nMkHOSTA8exdBIGUG1/WXxz5MvxkymDEzI5OZkUMcAO0UrQu9Eg9tlpDo8l4N4Iqd5sQ Wm1fbFOK1Zij7Wzx8S4Ji/jwAdwlRLRv48GLrN0bLObao7H0qkKmxGBZ0/d2Xb1yHEt+ kRkqqEPn9PjK1c35pKpEbguzEDDBfGgF+grvjUqgIY9w2gaZn2Bgan2tNiOmOVDxwz0Z CQ+x5VQs+/wSoaoEAtbbUGTUqIKHAbn0SkAO85SFAQlQV3LSX1nse9tVy7bkrn3cjo5o nm/w== X-Gm-Message-State: AJcUukcV9co1gAn0EICnXefH6g60VACwfXxqF06KnjVAjyKOluRwGW0m 7vLhZ46xpwSnPrPBh0I8b0hMDtrln5o= X-Received: by 2002:a50:b667:: with SMTP id c36mr9996768ede.190.1548399859489; Thu, 24 Jan 2019 23:04:19 -0800 (PST) Received: from localhost ([49.248.181.51]) by smtp.gmail.com with ESMTPSA id 49sm11802931edz.59.2019.01.24.23.04.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 24 Jan 2019 23:04:18 -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 9/9] cpufreq: scpi: Use auto-registration of thermal cooling device Date: Fri, 25 Jan 2019 12:32:29 +0530 Message-Id: <94d264be0f980396cf4d2b94ba31e55ef1bc304b.1548398851.git.amit.kucheria@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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(-) -- 2.17.1 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, };