Commit 6019d23a authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

cpufreq: Rearrange __cpufreq_driver_target()

Drop a pointless label at a return statement from
__cpufreq_driver_target() and rearrange that function
to reduce the indentation level.

No intentional functional changes.
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 41cfd64c
...@@ -1805,7 +1805,8 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, ...@@ -1805,7 +1805,8 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
unsigned int relation) unsigned int relation)
{ {
unsigned int old_target_freq = target_freq; unsigned int old_target_freq = target_freq;
int retval = -EINVAL; struct cpufreq_frequency_table *freq_table;
int index, retval;
if (cpufreq_disabled()) if (cpufreq_disabled())
return -ENODEV; return -ENODEV;
...@@ -1832,34 +1833,28 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy, ...@@ -1832,34 +1833,28 @@ int __cpufreq_driver_target(struct cpufreq_policy *policy,
policy->restore_freq = policy->cur; policy->restore_freq = policy->cur;
if (cpufreq_driver->target) if (cpufreq_driver->target)
retval = cpufreq_driver->target(policy, target_freq, relation); return cpufreq_driver->target(policy, target_freq, relation);
else if (cpufreq_driver->target_index) {
struct cpufreq_frequency_table *freq_table; if (!cpufreq_driver->target_index)
int index; return -EINVAL;
freq_table = cpufreq_frequency_get_table(policy->cpu); freq_table = cpufreq_frequency_get_table(policy->cpu);
if (unlikely(!freq_table)) { if (unlikely(!freq_table)) {
pr_err("%s: Unable to find freq_table\n", __func__); pr_err("%s: Unable to find freq_table\n", __func__);
goto out; return -EINVAL;
} }
retval = cpufreq_frequency_table_target(policy, freq_table, retval = cpufreq_frequency_table_target(policy, freq_table, target_freq,
target_freq, relation, &index); relation, &index);
if (unlikely(retval)) { if (unlikely(retval)) {
pr_err("%s: Unable to find matching freq\n", __func__); pr_err("%s: Unable to find matching freq\n", __func__);
goto out; return retval;
}
if (freq_table[index].frequency == policy->cur) {
retval = 0;
goto out;
} }
retval = __target_index(policy, freq_table, index); if (freq_table[index].frequency == policy->cur)
} return 0;
out: return __target_index(policy, freq_table, index);
return retval;
} }
EXPORT_SYMBOL_GPL(__cpufreq_driver_target); EXPORT_SYMBOL_GPL(__cpufreq_driver_target);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment