diff options
Diffstat (limited to 'drivers/cpuidle/cpuidle.c')
-rw-r--r-- | drivers/cpuidle/cpuidle.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 7f15b8514a18..b511ac39cc85 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c | |||
@@ -394,7 +394,6 @@ EXPORT_SYMBOL_GPL(cpuidle_disable_device); | |||
394 | static int __cpuidle_register_device(struct cpuidle_device *dev) | 394 | static int __cpuidle_register_device(struct cpuidle_device *dev) |
395 | { | 395 | { |
396 | int ret; | 396 | int ret; |
397 | struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); | ||
398 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); | 397 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); |
399 | 398 | ||
400 | if (!try_module_get(cpuidle_driver->owner)) | 399 | if (!try_module_get(cpuidle_driver->owner)) |
@@ -404,7 +403,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) | |||
404 | 403 | ||
405 | per_cpu(cpuidle_devices, dev->cpu) = dev; | 404 | per_cpu(cpuidle_devices, dev->cpu) = dev; |
406 | list_add(&dev->device_list, &cpuidle_detected_devices); | 405 | list_add(&dev->device_list, &cpuidle_detected_devices); |
407 | ret = cpuidle_add_sysfs(cpu_dev); | 406 | ret = cpuidle_add_sysfs(dev); |
408 | if (ret) | 407 | if (ret) |
409 | goto err_sysfs; | 408 | goto err_sysfs; |
410 | 409 | ||
@@ -416,7 +415,7 @@ static int __cpuidle_register_device(struct cpuidle_device *dev) | |||
416 | return 0; | 415 | return 0; |
417 | 416 | ||
418 | err_coupled: | 417 | err_coupled: |
419 | cpuidle_remove_sysfs(cpu_dev); | 418 | cpuidle_remove_sysfs(dev); |
420 | wait_for_completion(&dev->kobj_unregister); | 419 | wait_for_completion(&dev->kobj_unregister); |
421 | err_sysfs: | 420 | err_sysfs: |
422 | list_del(&dev->device_list); | 421 | list_del(&dev->device_list); |
@@ -460,7 +459,6 @@ EXPORT_SYMBOL_GPL(cpuidle_register_device); | |||
460 | */ | 459 | */ |
461 | void cpuidle_unregister_device(struct cpuidle_device *dev) | 460 | void cpuidle_unregister_device(struct cpuidle_device *dev) |
462 | { | 461 | { |
463 | struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu); | ||
464 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); | 462 | struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); |
465 | 463 | ||
466 | if (dev->registered == 0) | 464 | if (dev->registered == 0) |
@@ -470,7 +468,7 @@ void cpuidle_unregister_device(struct cpuidle_device *dev) | |||
470 | 468 | ||
471 | cpuidle_disable_device(dev); | 469 | cpuidle_disable_device(dev); |
472 | 470 | ||
473 | cpuidle_remove_sysfs(cpu_dev); | 471 | cpuidle_remove_sysfs(dev); |
474 | list_del(&dev->device_list); | 472 | list_del(&dev->device_list); |
475 | wait_for_completion(&dev->kobj_unregister); | 473 | wait_for_completion(&dev->kobj_unregister); |
476 | per_cpu(cpuidle_devices, dev->cpu) = NULL; | 474 | per_cpu(cpuidle_devices, dev->cpu) = NULL; |