提交 1eada11c 编写于 作者: G Greg Kroah-Hartman

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 <clameter@sgi.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 cf15126b
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册