[PATCH 3/4] cpufreq: scmi: Move scmi_cpufreq_driver structure to the top

Lukasz Luba lukasz.luba at arm.com
Wed Jul 29 11:12:07 EDT 2020


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 <lukasz.luba at arm.com>
---
 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




More information about the linux-arm-kernel mailing list