diff options
author | Viresh Kumar <viresh.kumar@linaro.org> | 2013-09-16 18:56:03 +0530 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-30 20:18:40 +0200 |
commit | 27047a603645d0885bcd72d7a0b6cce6e3c94ca7 (patch) | |
tree | 127e4ab6c9f749d1917014c7bb84e0d63655aad5 /include/linux/cpufreq.h | |
parent | 15c03dd4859ab16f9212238f29dd315654aa94f6 (diff) | |
download | talos-obmc-linux-27047a603645d0885bcd72d7a0b6cce6e3c94ca7.tar.gz talos-obmc-linux-27047a603645d0885bcd72d7a0b6cce6e3c94ca7.zip |
cpufreq: Add new helper cpufreq_table_validate_and_show()
Almost every cpufreq driver is required to validate its frequency table with:
cpufreq_frequency_table_cpuinfo() and then expose it to cpufreq core with:
cpufreq_frequency_table_get_attr().
This patch creates another helper routine cpufreq_table_validate_and_show() that
will do both these steps in a single call and will return 0 for success, error
otherwise.
This also fixes potential bugs in cpufreq drivers where people have called
cpufreq_frequency_table_get_attr() before calling
cpufreq_frequency_table_cpuinfo(), as the later may fail.
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r-- | include/linux/cpufreq.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index fcabc42d66ab..6b199ed7aa58 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -410,5 +410,7 @@ extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, unsigned int cpu); void cpufreq_frequency_table_put_attr(unsigned int cpu); +int cpufreq_table_validate_and_show(struct cpufreq_policy *policy, + struct cpufreq_frequency_table *table); #endif /* _LINUX_CPUFREQ_H */ |