From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8AFCDC433E0 for ; Wed, 29 Jul 2020 15:12:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 641982083B for ; Wed, 29 Jul 2020 15:12:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726998AbgG2PMi (ORCPT ); Wed, 29 Jul 2020 11:12:38 -0400 Received: from foss.arm.com ([217.140.110.172]:53434 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726958AbgG2PMe (ORCPT ); Wed, 29 Jul 2020 11:12:34 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3F9EDD6E; Wed, 29 Jul 2020 08:12:28 -0700 (PDT) Received: from e123648.arm.com (unknown [10.37.12.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 252B03F66E; Wed, 29 Jul 2020 08:12:25 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Cc: sudeep.holla@arm.com, cristian.marussi@arm.com, viresh.kumar@linaro.org, lukasz.luba@arm.com, rjw@rjwysocki.net Subject: [PATCH 3/4] cpufreq: scmi: Move scmi_cpufreq_driver structure to the top Date: Wed, 29 Jul 2020 16:12:07 +0100 Message-Id: <20200729151208.27737-4-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200729151208.27737-1-lukasz.luba@arm.com> References: <20200729151208.27737-1-lukasz.luba@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the scmi_cpufreq_driver to top of the file in order to prepare for upcoming changes, which will extend it based on discoverable functionality. Signed-off-by: Lukasz Luba --- drivers/cpufreq/scmi-cpufreq.c | 36 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index fb42e3390377..fe95350eb844 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -24,6 +24,28 @@ struct scmi_data { struct device *cpu_dev; }; +static unsigned int scmi_cpufreq_get_rate(unsigned int cpu); +static int scmi_cpufreq_set_target(struct cpufreq_policy *policy, + unsigned int index); +static unsigned int scmi_cpufreq_fast_switch(struct cpufreq_policy *policy, + unsigned int target_freq); +static int scmi_cpufreq_init(struct cpufreq_policy *policy); +static int scmi_cpufreq_exit(struct cpufreq_policy *policy); + +static struct cpufreq_driver scmi_cpufreq_driver = { + .name = "scmi", + .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | + CPUFREQ_NEED_INITIAL_FREQ_CHECK | + CPUFREQ_IS_COOLING_DEV, + .verify = cpufreq_generic_frequency_table_verify, + .attr = cpufreq_generic_attr, + .target_index = scmi_cpufreq_set_target, + .fast_switch = scmi_cpufreq_fast_switch, + .get = scmi_cpufreq_get_rate, + .init = scmi_cpufreq_init, + .exit = scmi_cpufreq_exit, +}; + static const struct scmi_handle *handle; static unsigned int scmi_cpufreq_get_rate(unsigned int cpu) @@ -219,20 +241,6 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) return 0; } -static struct cpufreq_driver scmi_cpufreq_driver = { - .name = "scmi", - .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | - CPUFREQ_NEED_INITIAL_FREQ_CHECK | - CPUFREQ_IS_COOLING_DEV, - .verify = cpufreq_generic_frequency_table_verify, - .attr = cpufreq_generic_attr, - .target_index = scmi_cpufreq_set_target, - .fast_switch = scmi_cpufreq_fast_switch, - .get = scmi_cpufreq_get_rate, - .init = scmi_cpufreq_init, - .exit = scmi_cpufreq_exit, -}; - static int scmi_cpufreq_probe(struct scmi_device *sdev) { int ret; -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52A9AC433E3 for ; Wed, 29 Jul 2020 15:14:28 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0AE752083B for ; Wed, 29 Jul 2020 15:14:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WsoAz2FV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0AE752083B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:To: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1Hb8ftR6UpgUqvm9txMcci+YcA+QHLE+bAlz2MPgQqc=; b=WsoAz2FV6gxHW8Wc6OqHNUscBu PW+WMRILuDybInT/QOULPsy9RV/DsqHk7o6dx2/rcYMl5wgpFzzZJ+SgEtSW038q5tmhLPWd+7WG6 8kqzHyroREfXo+W2Nwa+YWdijJy2n6dtRLK/8d3Y4vFevlgClNvmNv6gB/p25XDKsXPgpbRNcEvkg at4GjhVgppD+9rgFfcFa1V2Urq4X8jqQM3A3TDhoNeLq/RkzpCDioxDHEpiV0fJQh8CQteCLi7iJZ Bjy14W6edf/veQQN9hdKj6XVOw5leEl6SkvNJhlPMPxn8s+Ss4jQrm2VKzkfQjymUxdDMcA+KxeVO VdMFo0Zg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0nlR-0006An-0n; Wed, 29 Jul 2020 15:13:05 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0nks-0005zq-Q2 for linux-arm-kernel@lists.infradead.org; Wed, 29 Jul 2020 15:12:34 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 3F9EDD6E; Wed, 29 Jul 2020 08:12:28 -0700 (PDT) Received: from e123648.arm.com (unknown [10.37.12.35]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 252B03F66E; Wed, 29 Jul 2020 08:12:25 -0700 (PDT) From: Lukasz Luba To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org Subject: [PATCH 3/4] cpufreq: scmi: Move scmi_cpufreq_driver structure to the top Date: Wed, 29 Jul 2020 16:12:07 +0100 Message-Id: <20200729151208.27737-4-lukasz.luba@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200729151208.27737-1-lukasz.luba@arm.com> References: <20200729151208.27737-1-lukasz.luba@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200729_111230_958008_5A5D3410 X-CRM114-Status: GOOD ( 12.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: viresh.kumar@linaro.org, rjw@rjwysocki.net, lukasz.luba@arm.com, cristian.marussi@arm.com, sudeep.holla@arm.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Move the scmi_cpufreq_driver to top of the file in order to prepare for upcoming changes, which will extend it based on discoverable functionality. Signed-off-by: Lukasz Luba --- drivers/cpufreq/scmi-cpufreq.c | 36 +++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index fb42e3390377..fe95350eb844 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -24,6 +24,28 @@ struct scmi_data { struct device *cpu_dev; }; +static unsigned int scmi_cpufreq_get_rate(unsigned int cpu); +static int scmi_cpufreq_set_target(struct cpufreq_policy *policy, + unsigned int index); +static unsigned int scmi_cpufreq_fast_switch(struct cpufreq_policy *policy, + unsigned int target_freq); +static int scmi_cpufreq_init(struct cpufreq_policy *policy); +static int scmi_cpufreq_exit(struct cpufreq_policy *policy); + +static struct cpufreq_driver scmi_cpufreq_driver = { + .name = "scmi", + .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | + CPUFREQ_NEED_INITIAL_FREQ_CHECK | + CPUFREQ_IS_COOLING_DEV, + .verify = cpufreq_generic_frequency_table_verify, + .attr = cpufreq_generic_attr, + .target_index = scmi_cpufreq_set_target, + .fast_switch = scmi_cpufreq_fast_switch, + .get = scmi_cpufreq_get_rate, + .init = scmi_cpufreq_init, + .exit = scmi_cpufreq_exit, +}; + static const struct scmi_handle *handle; static unsigned int scmi_cpufreq_get_rate(unsigned int cpu) @@ -219,20 +241,6 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) return 0; } -static struct cpufreq_driver scmi_cpufreq_driver = { - .name = "scmi", - .flags = CPUFREQ_STICKY | CPUFREQ_HAVE_GOVERNOR_PER_POLICY | - CPUFREQ_NEED_INITIAL_FREQ_CHECK | - CPUFREQ_IS_COOLING_DEV, - .verify = cpufreq_generic_frequency_table_verify, - .attr = cpufreq_generic_attr, - .target_index = scmi_cpufreq_set_target, - .fast_switch = scmi_cpufreq_fast_switch, - .get = scmi_cpufreq_get_rate, - .init = scmi_cpufreq_init, - .exit = scmi_cpufreq_exit, -}; - static int scmi_cpufreq_probe(struct scmi_device *sdev) { int ret; -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel