@@ -203,7 +203,6 @@ static struct thermal_soc_data thermal_imx7d_data = {
struct imx_thermal_data {
struct cpufreq_policy *policy;
struct thermal_zone_device *tz;
- struct thermal_cooling_device *cdev;
enum thermal_device_mode mode;
struct regmap *tempmon;
u32 c1, c2; /* See formula in imx_init_calib() */
@@ -656,6 +655,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
{
struct device_node *np;
+ struct thermal_cooling_device *cdev;
int ret;
data->policy = cpufreq_cpu_get(0);
@@ -667,9 +667,9 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
np = of_get_cpu_node(data->policy->cpu, NULL);
if (!np || !of_find_property(np, "#cooling-cells", NULL)) {
- data->cdev = cpufreq_cooling_register(data->policy);
- if (IS_ERR(data->cdev)) {
- ret = PTR_ERR(data->cdev);
+ cdev = cpufreq_cooling_register(data->policy);
+ if (IS_ERR(cdev)) {
+ ret = PTR_ERR(cdev);
cpufreq_cpu_put(data->policy);
return ret;
}
The cpufreq_cooling_unregister() function uses now the policy to unregister itself. The only purpose of the cooling device pointer is to unregister the cpu cooling device. As there is no more need of this pointer, remove it. Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> --- drivers/thermal/imx_thermal.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.17.1