Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cf15126b3d4511e06e5299781ab74922590900be
Commit:     cf15126b3d4511e06e5299781ab74922590900be
Parent:     e43b9192c59402685bd1f809068dd13aa5931570
Author:     Greg Kroah-Hartman <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 17 23:05:35 2007 -0700
Committer:  Greg Kroah-Hartman <[EMAIL PROTECTED]>
CommitDate: Thu Jan 24 20:40:31 2008 -0800

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 kernel/user.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/user.c b/kernel/user.c
index 7f17e6e..ab4fd70 100644
--- a/kernel/user.c
+++ b/kernel/user.c
@@ -181,13 +181,12 @@ static int uids_user_create(struct user_struct *up)
        int error;
 
        memset(kobj, 0, sizeof(struct kobject));
-       kobj->ktype = &uids_ktype;
        kobj->kset = uids_kset;
-       kobject_init(kobj);
-       kobject_set_name(&up->kobj, "%d", up->uid);
-       error = kobject_add(kobj);
-       if (error)
+       error = kobject_init_and_add(kobj, &uids_ktype, NULL, "%d", up->uid);
+       if (error) {
+               kobject_put(kobj);
                goto done;
+       }
 
        kobject_uevent(kobj, KOBJ_ADD);
 done:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to