Skip to content

Commit cf736ea

Browse files
dtorEduardo Valentin
authored andcommitted
thermal: power_allocator: do not use devm* interfaces
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>
1 parent 7ddab73 commit cf736ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/thermal/power_allocator.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ static int allocate_power(struct thermal_zone_device *tz,
334334
max_allocatable_power, current_temp,
335335
(s32)control_temp - (s32)current_temp);
336336

337-
devm_kfree(&tz->device, req_power);
337+
kfree(req_power);
338338
unlock:
339339
mutex_unlock(&tz->lock);
340340

@@ -426,7 +426,7 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
426426
return -EINVAL;
427427
}
428428

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

@@ -468,14 +468,14 @@ static int power_allocator_bind(struct thermal_zone_device *tz)
468468
return 0;
469469

470470
free:
471-
devm_kfree(&tz->device, params);
471+
kfree(params);
472472
return ret;
473473
}
474474

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

0 commit comments

Comments
 (0)