diff options
Diffstat (limited to 'drivers/cpuidle/sysfs.c')
-rw-r--r-- | drivers/cpuidle/sysfs.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c index 5f809e337b89..84e62852e50a 100644 --- a/drivers/cpuidle/sysfs.c +++ b/drivers/cpuidle/sysfs.c | |||
@@ -408,13 +408,11 @@ void cpuidle_remove_state_sysfs(struct cpuidle_device *device) | |||
408 | * cpuidle_add_sysfs - creates a sysfs instance for the target device | 408 | * cpuidle_add_sysfs - creates a sysfs instance for the target device |
409 | * @dev: the target device | 409 | * @dev: the target device |
410 | */ | 410 | */ |
411 | int cpuidle_add_sysfs(struct device *cpu_dev) | 411 | int cpuidle_add_sysfs(struct cpuidle_device *dev) |
412 | { | 412 | { |
413 | int cpu = cpu_dev->id; | 413 | struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); |
414 | struct cpuidle_device *dev; | ||
415 | int error; | 414 | int error; |
416 | 415 | ||
417 | dev = per_cpu(cpuidle_devices, cpu); | ||
418 | error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &cpu_dev->kobj, | 416 | error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &cpu_dev->kobj, |
419 | "cpuidle"); | 417 | "cpuidle"); |
420 | if (!error) | 418 | if (!error) |
@@ -426,11 +424,7 @@ int cpuidle_add_sysfs(struct device *cpu_dev) | |||
426 | * cpuidle_remove_sysfs - deletes a sysfs instance on the target device | 424 | * cpuidle_remove_sysfs - deletes a sysfs instance on the target device |
427 | * @dev: the target device | 425 | * @dev: the target device |
428 | */ | 426 | */ |
429 | void cpuidle_remove_sysfs(struct device *cpu_dev) | 427 | void cpuidle_remove_sysfs(struct cpuidle_device *dev) |
430 | { | 428 | { |
431 | int cpu = cpu_dev->id; | ||
432 | struct cpuidle_device *dev; | ||
433 | |||
434 | dev = per_cpu(cpuidle_devices, cpu); | ||
435 | kobject_put(&dev->kobj); | 429 | kobject_put(&dev->kobj); |
436 | } | 430 | } |