Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1eada11c88251e0a30ce5690d2607bb4293b3564
Commit:     1eada11c88251e0a30ce5690d2607bb4293b3564
Parent:     cf15126b3d4511e06e5299781ab74922590900be
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 mm/slub.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: Christoph Lameter <[EMAIL PROTECTED]>
    Cc: Kay Sievers <[EMAIL PROTECTED]>
    Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
---
 mm/slub.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index d26177f..5cc4b7d 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4025,13 +4025,12 @@ static int sysfs_slab_add(struct kmem_cache *s)
                name = create_unique_id(s);
        }
 
-       kobject_set_name(&s->kobj, name);
        s->kobj.kset = slab_kset;
-       s->kobj.ktype = &slab_ktype;
-       kobject_init(&s->kobj);
-       err = kobject_add(&s->kobj);
-       if (err)
+       err = kobject_init_and_add(&s->kobj, &slab_ktype, NULL, name);
+       if (err) {
+               kobject_put(&s->kobj);
                return err;
+       }
 
        err = sysfs_create_group(&s->kobj, &slab_attr_group);
        if (err)
-
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