diff options
Diffstat (limited to 'drivers/cpuidle/sysfs.c')
-rw-r--r-- | drivers/cpuidle/sysfs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index 8a1ace104476..1e756e160dca 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c | |||
@@ -322,13 +322,14 @@ int cpuidle_add_state_sysfs(struct cpuidle_device *device) | |||
322 | { | 322 | { |
323 | int i, ret = -ENOMEM; | 323 | int i, ret = -ENOMEM; |
324 | struct cpuidle_state_kobj *kobj; | 324 | struct cpuidle_state_kobj *kobj; |
325 | struct cpuidle_driver *drv = cpuidle_get_driver(); | ||
325 | 326 | ||
326 | /* state statistics */ | 327 | /* state statistics */ |
327 | for (i = 0; i < device->state_count; i++) { | 328 | for (i = 0; i < device->state_count; i++) { |
328 | kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL); | 329 | kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL); |
329 | if (!kobj) | 330 | if (!kobj) |
330 | goto error_state; | 331 | goto error_state; |
331 | kobj->state = &device->states[i]; | 332 | kobj->state = &drv->states[i]; |
332 | kobj->state_usage = &device->states_usage[i]; | 333 | kobj->state_usage = &device->states_usage[i]; |
333 | init_completion(&kobj->kobj_unregister); | 334 | init_completion(&kobj->kobj_unregister); |
334 | 335 | ||