diff options
author | Stratos Karafotis <stratosk@semaphore.gr> | 2014-04-25 16:15:38 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-04-29 18:06:21 -0400 |
commit | 041526f915a90b2b628cd0253e2c85da8040276d (patch) | |
tree | 0d2a0c45505584f942bd30723af84d2c09261de3 /drivers/cpufreq/ppc_cbe_cpufreq.c | |
parent | 27e289dce29764e488c1e13e9aa6950cad1f4aab (diff) |
cpufreq: Use cpufreq_for_each_* macros for frequency table iteration
The cpufreq core now supports the cpufreq_for_each_entry and
cpufreq_for_each_valid_entry macros helpers for iteration over the
cpufreq_frequency_table, so use them.
It should have no functional changes.
Signed-off-by: Stratos Karafotis <stratosk@semaphore.gr>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/ppc_cbe_cpufreq.c')
-rw-r--r-- | drivers/cpufreq/ppc_cbe_cpufreq.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/cpufreq/ppc_cbe_cpufreq.c b/drivers/cpufreq/ppc_cbe_cpufreq.c index 5be8a48dba74..5a4c5a639f61 100644 --- a/drivers/cpufreq/ppc_cbe_cpufreq.c +++ b/drivers/cpufreq/ppc_cbe_cpufreq.c | |||
@@ -67,9 +67,10 @@ static int set_pmode(unsigned int cpu, unsigned int slow_mode) | |||
67 | 67 | ||
68 | static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) | 68 | static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) |
69 | { | 69 | { |
70 | struct cpufreq_frequency_table *pos; | ||
70 | const u32 *max_freqp; | 71 | const u32 *max_freqp; |
71 | u32 max_freq; | 72 | u32 max_freq; |
72 | int i, cur_pmode; | 73 | int cur_pmode; |
73 | struct device_node *cpu; | 74 | struct device_node *cpu; |
74 | 75 | ||
75 | cpu = of_get_cpu_node(policy->cpu, NULL); | 76 | cpu = of_get_cpu_node(policy->cpu, NULL); |
@@ -102,9 +103,9 @@ static int cbe_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
102 | pr_debug("initializing frequency table\n"); | 103 | pr_debug("initializing frequency table\n"); |
103 | 104 | ||
104 | /* initialize frequency table */ | 105 | /* initialize frequency table */ |
105 | for (i=0; cbe_freqs[i].frequency!=CPUFREQ_TABLE_END; i++) { | 106 | cpufreq_for_each_entry(pos, cbe_freqs) { |
106 | cbe_freqs[i].frequency = max_freq / cbe_freqs[i].driver_data; | 107 | pos->frequency = max_freq / pos->driver_data; |
107 | pr_debug("%d: %d\n", i, cbe_freqs[i].frequency); | 108 | pr_debug("%d: %d\n", (int)(pos - cbe_freqs), pos->frequency); |
108 | } | 109 | } |
109 | 110 | ||
110 | /* if DEBUG is enabled set_pmode() measures the latency | 111 | /* if DEBUG is enabled set_pmode() measures the latency |