aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/sysfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cpuidle/sysfs.c')
-rw-r--r--drivers/cpuidle/sysfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 97c5903b4606..832a2c3f01ff 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -401,7 +401,7 @@ static int cpuidle_add_state_sysfs(struct cpuidle_device *device)
401 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device); 401 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device);
402 402
403 /* state statistics */ 403 /* state statistics */
404 for (i = 0; i < device->state_count; i++) { 404 for (i = 0; i < drv->state_count; i++) {
405 kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL); 405 kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL);
406 if (!kobj) 406 if (!kobj)
407 goto error_state; 407 goto error_state;
@@ -433,9 +433,10 @@ error_state:
433 */ 433 */
434static void cpuidle_remove_state_sysfs(struct cpuidle_device *device) 434static void cpuidle_remove_state_sysfs(struct cpuidle_device *device)
435{ 435{
436 struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device);
436 int i; 437 int i;
437 438
438 for (i = 0; i < device->state_count; i++) 439 for (i = 0; i < drv->state_count; i++)
439 cpuidle_free_state_kobj(device, i); 440 cpuidle_free_state_kobj(device, i);
440} 441}
441 442