mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
Kobject: convert kernel/user.c to use kobject_init/add_ng()
This converts the code to use the new kobject functions, cleaning up the logic in doing so. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
e43b9192c5
commit
cf15126b3d
1 changed files with 4 additions and 5 deletions
|
@ -181,13 +181,12 @@ static int uids_user_create(struct user_struct *up)
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
memset(kobj, 0, sizeof(struct kobject));
|
memset(kobj, 0, sizeof(struct kobject));
|
||||||
kobj->ktype = &uids_ktype;
|
|
||||||
kobj->kset = uids_kset;
|
kobj->kset = uids_kset;
|
||||||
kobject_init(kobj);
|
error = kobject_init_and_add(kobj, &uids_ktype, NULL, "%d", up->uid);
|
||||||
kobject_set_name(&up->kobj, "%d", up->uid);
|
if (error) {
|
||||||
error = kobject_add(kobj);
|
kobject_put(kobj);
|
||||||
if (error)
|
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
kobject_uevent(kobj, KOBJ_ADD);
|
kobject_uevent(kobj, KOBJ_ADD);
|
||||||
done:
|
done:
|
||||||
|
|
Loading…
Reference in a new issue