|
@@ -401,7 +401,7 @@ static int cpuidle_add_state_sysfs(struct cpuidle_device *device)
|
|
struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device);
|
|
struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device);
|
|
|
|
|
|
/* state statistics */
|
|
/* state statistics */
|
|
- for (i = 0; i < device->state_count; i++) {
|
|
|
|
|
|
+ for (i = 0; i < drv->state_count; i++) {
|
|
kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL);
|
|
kobj = kzalloc(sizeof(struct cpuidle_state_kobj), GFP_KERNEL);
|
|
if (!kobj)
|
|
if (!kobj)
|
|
goto error_state;
|
|
goto error_state;
|
|
@@ -433,9 +433,10 @@ error_state:
|
|
*/
|
|
*/
|
|
static void cpuidle_remove_state_sysfs(struct cpuidle_device *device)
|
|
static void cpuidle_remove_state_sysfs(struct cpuidle_device *device)
|
|
{
|
|
{
|
|
|
|
+ struct cpuidle_driver *drv = cpuidle_get_cpu_driver(device);
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < device->state_count; i++)
|
|
|
|
|
|
+ for (i = 0; i < drv->state_count; i++)
|
|
cpuidle_free_state_kobj(device, i);
|
|
cpuidle_free_state_kobj(device, i);
|
|
}
|
|
}
|
|
|
|
|