Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75803
b: refs/heads/master
c: 94f57f3
h: refs/heads/master
i:
  75801: 6020fab
  75799: b1cbcac
v: v3
  • Loading branch information
Greg Kroah-Hartman committed Jan 25, 2008
1 parent 91d2f35 commit 40e872a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 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: b2ed215a3338b8b16187be8d136153054118a41e
refs/heads/master: 94f57f33680922197581b127b3badde7ef658258
17 changes: 9 additions & 8 deletions trunk/drivers/cpuidle/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,13 @@ int cpuidle_add_state_sysfs(struct cpuidle_device *device)
kobj->state = &device->states[i];
init_completion(&kobj->kobj_unregister);

kobj->kobj.parent = &device->kobj;
kobj->kobj.ktype = &ktype_state_cpuidle;
kobject_set_name(&kobj->kobj, "state%d", i);
ret = kobject_register(&kobj->kobj);
ret = kobject_init_and_add(&kobj->kobj, &ktype_state_cpuidle, &device->kobj,
"state%d", i);
if (ret) {
kfree(kobj);
goto error_state;
}
kobject_uevent(&kobj->kobj, KOBJ_ADD);
device->kobjs[i] = kobj;
}

Expand Down Expand Up @@ -339,12 +338,14 @@ int cpuidle_add_sysfs(struct sys_device *sysdev)
{
int cpu = sysdev->id;
struct cpuidle_device *dev;
int error;

dev = per_cpu(cpuidle_devices, cpu);
dev->kobj.parent = &sysdev->kobj;
dev->kobj.ktype = &ktype_cpuidle;
kobject_set_name(&dev->kobj, "%s", "cpuidle");
return kobject_register(&dev->kobj);
error = kobject_init_and_add(&dev->kobj, &ktype_cpuidle, &sysdev->kobj,
"cpuidle");
if (!error)
kobject_uevent(&dev->kobj, KOBJ_ADD);
return error;
}

/**
Expand Down

0 comments on commit 40e872a

Please sign in to comment.