cpu_cooling: Make of_cpufreq_power_cooling_register() parse DT

All the callers of of_cpufreq_power_cooling_register() have almost
identical code and it makes more sense to move that code into the helper
as its all about reading DT properties.

This got rid of lot of redundant code.

Acked-by: Eduardo Valentin <edubezval@gmail.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Viresh Kumar 2017-12-05 11:02:43 +05:30 committed by Rafael J. Wysocki
parent ae64f9bd1d
commit f5f263fed6
7 changed files with 41 additions and 116 deletions

View file

@ -56,10 +56,7 @@ of_cpufreq_cooling_register(struct device_node *np,
struct cpufreq_policy *policy);
struct thermal_cooling_device *
of_cpufreq_power_cooling_register(struct device_node *np,
struct cpufreq_policy *policy,
u32 capacitance,
get_static_t plat_static_func);
of_cpufreq_power_cooling_register(struct cpufreq_policy *policy);
#else
static inline struct thermal_cooling_device *
of_cpufreq_cooling_register(struct device_node *np,
@ -69,10 +66,7 @@ of_cpufreq_cooling_register(struct device_node *np,
}
static inline struct thermal_cooling_device *
of_cpufreq_power_cooling_register(struct device_node *np,
struct cpufreq_policy *policy,
u32 capacitance,
get_static_t plat_static_func)
of_cpufreq_power_cooling_register(struct cpufreq_policy *policy)
{
return NULL;
}
@ -105,10 +99,7 @@ of_cpufreq_cooling_register(struct device_node *np,
}
static inline struct thermal_cooling_device *
of_cpufreq_power_cooling_register(struct device_node *np,
struct cpufreq_policy *policy,
u32 capacitance,
get_static_t plat_static_func)
of_cpufreq_power_cooling_register(struct cpufreq_policy *policy)
{
return NULL;
}