Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336725
b: refs/heads/master
c: e45a00d
h: refs/heads/master
i:
  336723: 8af6de9
v: v3
  • Loading branch information
Daniel Lezcano authored and Rafael J. Wysocki committed Nov 14, 2012
1 parent 52beed3 commit 57aaef5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1aef40e288acfb3cc28ff77528b34ef66683bed6
refs/heads/master: e45a00d679a788217f35ee4214a32d6d1924160b
4 changes: 0 additions & 4 deletions trunk/drivers/cpuidle/cpuidle.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,6 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)
if (!try_module_get(cpuidle_driver->owner))
return -EINVAL;

init_completion(&dev->kobj_unregister);

per_cpu(cpuidle_devices, dev->cpu) = dev;
list_add(&dev->device_list, &cpuidle_detected_devices);
ret = cpuidle_add_sysfs(dev);
Expand All @@ -416,7 +414,6 @@ static int __cpuidle_register_device(struct cpuidle_device *dev)

err_coupled:
cpuidle_remove_sysfs(dev);
wait_for_completion(&dev->kobj_unregister);
err_sysfs:
list_del(&dev->device_list);
per_cpu(cpuidle_devices, dev->cpu) = NULL;
Expand Down Expand Up @@ -470,7 +467,6 @@ void cpuidle_unregister_device(struct cpuidle_device *dev)

cpuidle_remove_sysfs(dev);
list_del(&dev->device_list);
wait_for_completion(&dev->kobj_unregister);
per_cpu(cpuidle_devices, dev->cpu) = NULL;

cpuidle_coupled_unregister_device(dev);
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/cpuidle/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ int cpuidle_add_state_sysfs(struct cpuidle_device *device)
kobj->state_usage = &device->states_usage[i];
init_completion(&kobj->kobj_unregister);

ret = kobject_init_and_add(&kobj->kobj, &ktype_state_cpuidle, &device->kobj,
"state%d", i);
ret = kobject_init_and_add(&kobj->kobj, &ktype_state_cpuidle,
&device->kobj, "state%d", i);
if (ret) {
kfree(kobj);
goto error_state;
Expand Down Expand Up @@ -413,6 +413,8 @@ int cpuidle_add_sysfs(struct cpuidle_device *dev)
struct device *cpu_dev = get_cpu_device((unsigned long)dev->cpu);
int error;

init_completion(&dev->kobj_unregister);

error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &cpu_dev->kobj,
"cpuidle");
if (!error)
Expand All @@ -427,4 +429,5 @@ int cpuidle_add_sysfs(struct cpuidle_device *dev)
void cpuidle_remove_sysfs(struct cpuidle_device *dev)
{
kobject_put(&dev->kobj);
wait_for_completion(&dev->kobj_unregister);
}

0 comments on commit 57aaef5

Please sign in to comment.