cpuidle: Single/Global registration of idle states
[pandora-kernel.git] / drivers / cpuidle / sysfs.c
index 8a1ace1..1e756e1 100644 (file)
@@ -322,13 +322,14 @@ int cpuidle_add_state_sysfs(struct cpuidle_device *device)
 {
        int i, ret = -ENOMEM;
        struct cpuidle_state_kobj *kobj;
+       struct cpuidle_driver *drv = cpuidle_get_driver();
 
        /* state statistics */
        for (i = 0; i < device->state_count; i++) {
                kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL);
                if (!kobj)
                        goto error_state;
-               kobj->state = &device->states[i];
+               kobj->state = &drv->states[i];
                kobj->state_usage = &device->states_usage[i];
                init_completion(&kobj->kobj_unregister);