From ad889f2d5c9fe1b49c9c56f1b717c7ea20910252 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 17 Dec 2007 23:05:35 -0700 Subject: [PATCH] --- yaml --- r: 75851 b: refs/heads/master c: 9e7bbccd0290e720e0874443932869c55f63d5a8 h: refs/heads/master i: 75849: df6dd20eebc2931f50f09613d03f411e21528522 75847: 115529bbd6c0bbaffbd3f037e94b172b759ba790 v: v3 --- [refs] | 2 +- trunk/include/linux/kobject.h | 1 - trunk/lib/kobject.c | 22 ++++++++-------------- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/[refs] b/[refs] index 9bfa809c8f29..efdf9a87fb5c 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ac3c8141f62f357169980ec21b7be6d29964a394 +refs/heads/master: 9e7bbccd0290e720e0874443932869c55f63d5a8 diff --git a/trunk/include/linux/kobject.h b/trunk/include/linux/kobject.h index bb6868475edb..8b0aa715fa2f 100644 --- a/trunk/include/linux/kobject.h +++ b/trunk/include/linux/kobject.h @@ -80,7 +80,6 @@ static inline const char * kobject_name(const struct kobject * kobj) extern void kobject_init(struct kobject *); extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype); -extern int __must_check kobject_add(struct kobject *); extern int __must_check kobject_add_ng(struct kobject *kobj, struct kobject *parent, const char *fmt, ...); diff --git a/trunk/lib/kobject.c b/trunk/lib/kobject.c index 493e991abb1b..d04789fa4da9 100644 --- a/trunk/lib/kobject.c +++ b/trunk/lib/kobject.c @@ -144,7 +144,7 @@ void kobject_init(struct kobject * kobj) * Remove the kobject from the kset list and decrement * its parent's refcount. * This is separated out, so we can use it in both - * kobject_del() and kobject_add() on error. + * kobject_del() and kobject_add_internal() on error. */ static void unlink(struct kobject * kobj) @@ -161,12 +161,7 @@ static void unlink(struct kobject * kobj) kobject_put(parent); } -/** - * kobject_add - add an object to the hierarchy. - * @kobj: object. - */ - -int kobject_add(struct kobject * kobj) +static int kobject_add_internal(struct kobject *kobj) { int error = 0; struct kobject * parent; @@ -215,13 +210,13 @@ int kobject_add(struct kobject * kobj) /* be noisy on error issues */ if (error == -EEXIST) - printk(KERN_ERR "kobject_add failed for %s with " + printk(KERN_ERR "%s failed for %s with " "-EEXIST, don't try to register things with " "the same name in the same directory.\n", - kobject_name(kobj)); + __FUNCTION__, kobject_name(kobj)); else - printk(KERN_ERR "kobject_add failed for %s (%d)\n", - kobject_name(kobj), error); + printk(KERN_ERR "%s failed for %s (%d)\n", + __FUNCTION__, kobject_name(kobj), error); dump_stack(); } @@ -351,7 +346,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent, return retval; } kobj->parent = parent; - return kobject_add(kobj); + return kobject_add_internal(kobj); } /** @@ -742,7 +737,7 @@ struct sysfs_ops kobj_sysfs_ops = { int kset_add(struct kset * k) { - return kobject_add(&k->kobj); + return kobject_add_internal(&k->kobj); } @@ -897,7 +892,6 @@ EXPORT_SYMBOL(kobject_register); EXPORT_SYMBOL(kobject_unregister); EXPORT_SYMBOL(kobject_get); EXPORT_SYMBOL(kobject_put); -EXPORT_SYMBOL(kobject_add); EXPORT_SYMBOL(kobject_del); EXPORT_SYMBOL(kset_register);