Commit 72554a75 authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Eduardo Valentin

thermal/drivers/cpu_cooling: Remove pointless field

The structure cpufreq_cooling_device provides a backpointer to the thermal
device but this one is used for a trace and to unregister. For the trace,
we don't really need this field and the unregister function as the same
pointer passed as parameter. Remove it.
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent 0fac9e2f
...@@ -87,7 +87,6 @@ struct cpufreq_cooling_device { ...@@ -87,7 +87,6 @@ struct cpufreq_cooling_device {
unsigned int clipped_freq; unsigned int clipped_freq;
unsigned int max_level; unsigned int max_level;
struct freq_table *freq_table; /* In descending order */ struct freq_table *freq_table; /* In descending order */
struct thermal_cooling_device *cdev;
struct cpufreq_policy *policy; struct cpufreq_policy *policy;
struct list_head node; struct list_head node;
struct time_in_idle *idle_time; struct time_in_idle *idle_time;
...@@ -195,8 +194,7 @@ static int update_freq_table(struct cpufreq_cooling_device *cpufreq_cdev, ...@@ -195,8 +194,7 @@ static int update_freq_table(struct cpufreq_cooling_device *cpufreq_cdev,
dev = get_cpu_device(cpu); dev = get_cpu_device(cpu);
if (unlikely(!dev)) { if (unlikely(!dev)) {
dev_warn(&cpufreq_cdev->cdev->device, pr_warn("No cpu device for cpu %d\n", cpu);
"No cpu device for cpu %d\n", cpu);
return -ENODEV; return -ENODEV;
} }
...@@ -679,7 +677,6 @@ __cpufreq_cooling_register(struct device_node *np, ...@@ -679,7 +677,6 @@ __cpufreq_cooling_register(struct device_node *np,
goto remove_ida; goto remove_ida;
cpufreq_cdev->clipped_freq = cpufreq_cdev->freq_table[0].frequency; cpufreq_cdev->clipped_freq = cpufreq_cdev->freq_table[0].frequency;
cpufreq_cdev->cdev = cdev;
mutex_lock(&cooling_list_lock); mutex_lock(&cooling_list_lock);
/* Register the notifier for first cpufreq cooling device */ /* Register the notifier for first cpufreq cooling device */
...@@ -797,7 +794,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev) ...@@ -797,7 +794,7 @@ void cpufreq_cooling_unregister(struct thermal_cooling_device *cdev)
cpufreq_unregister_notifier(&thermal_cpufreq_notifier_block, cpufreq_unregister_notifier(&thermal_cpufreq_notifier_block,
CPUFREQ_POLICY_NOTIFIER); CPUFREQ_POLICY_NOTIFIER);
thermal_cooling_device_unregister(cpufreq_cdev->cdev); thermal_cooling_device_unregister(cdev);
ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id); ida_simple_remove(&cpufreq_ida, cpufreq_cdev->id);
kfree(cpufreq_cdev->idle_time); kfree(cpufreq_cdev->idle_time);
kfree(cpufreq_cdev->freq_table); kfree(cpufreq_cdev->freq_table);
......
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