Skip to content

Commit

Permalink
thermal: power_allocator: do not use devm* interfaces
Browse files Browse the repository at this point in the history
The code in question is called outside of standard driver
probe()/remove() callbacks and thus will not benefit from use of devm*
infrastructure.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
dtor authored and Eduardo Valentin committed Aug 14, 2015
1 parent 7ddab73 commit cf736ea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/thermal/power_allocator.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ static int allocate_power(struct thermal_zone_device *tz,
max_allocatable_power, current_temp,
(s32)control_temp - (s32)current_temp);

devm_kfree(&tz->device, req_power);
kfree(req_power);
unlock:
mutex_unlock(&tz->lock);

Expand Down Expand Up @@ -426,7 +426,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
return -EINVAL;
}

params = devm_kzalloc(&tz->device, sizeof(*params), GFP_KERNEL);
params = kzalloc(sizeof(*params), GFP_KERNEL);
if (!params)
return -ENOMEM;

Expand Down Expand Up @@ -468,14 +468,14 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
return 0;

free:
devm_kfree(&tz->device, params);
kfree(params);
return ret;
}

static void power_allocator_unbind(struct thermal_zone_device *tz)
{
dev_dbg(&tz->device, "Unbinding from thermal zone %d\n", tz->id);
devm_kfree(&tz->device, tz->governor_data);
kfree(tz->governor_data);
tz->governor_data = NULL;
}

Expand Down

0 comments on commit cf736ea

Please sign in to comment.