Commit 9e7bbccd authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Kobject: remove kobject_add() as no one uses it anymore

The old kobject_add() function is on longer in use, so let us remove it
from the public scope (kset mess in the kobject.c file still uses it,
but that can be cleaned up later very simply.)

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ac3c8141
...@@ -80,7 +80,6 @@ static inline const char * kobject_name(const struct kobject * kobj) ...@@ -80,7 +80,6 @@ static inline const char * kobject_name(const struct kobject * kobj)
extern void kobject_init(struct kobject *); extern void kobject_init(struct kobject *);
extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype); 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, extern int __must_check kobject_add_ng(struct kobject *kobj,
struct kobject *parent, struct kobject *parent,
const char *fmt, ...); const char *fmt, ...);
......
...@@ -144,7 +144,7 @@ void kobject_init(struct kobject * kobj) ...@@ -144,7 +144,7 @@ void kobject_init(struct kobject * kobj)
* Remove the kobject from the kset list and decrement * Remove the kobject from the kset list and decrement
* its parent's refcount. * its parent's refcount.
* This is separated out, so we can use it in both * 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) static void unlink(struct kobject * kobj)
...@@ -161,12 +161,7 @@ static void unlink(struct kobject * kobj) ...@@ -161,12 +161,7 @@ static void unlink(struct kobject * kobj)
kobject_put(parent); kobject_put(parent);
} }
/** static int kobject_add_internal(struct kobject *kobj)
* kobject_add - add an object to the hierarchy.
* @kobj: object.
*/
int kobject_add(struct kobject * kobj)
{ {
int error = 0; int error = 0;
struct kobject * parent; struct kobject * parent;
...@@ -215,13 +210,13 @@ int kobject_add(struct kobject * kobj) ...@@ -215,13 +210,13 @@ int kobject_add(struct kobject * kobj)
/* be noisy on error issues */ /* be noisy on error issues */
if (error == -EEXIST) 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 " "-EEXIST, don't try to register things with "
"the same name in the same directory.\n", "the same name in the same directory.\n",
kobject_name(kobj)); __FUNCTION__, kobject_name(kobj));
else else
printk(KERN_ERR "kobject_add failed for %s (%d)\n", printk(KERN_ERR "%s failed for %s (%d)\n",
kobject_name(kobj), error); __FUNCTION__, kobject_name(kobj), error);
dump_stack(); dump_stack();
} }
...@@ -351,7 +346,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent, ...@@ -351,7 +346,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
return retval; return retval;
} }
kobj->parent = parent; kobj->parent = parent;
return kobject_add(kobj); return kobject_add_internal(kobj);
} }
/** /**
...@@ -742,7 +737,7 @@ struct sysfs_ops kobj_sysfs_ops = { ...@@ -742,7 +737,7 @@ struct sysfs_ops kobj_sysfs_ops = {
int kset_add(struct kset * k) 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); ...@@ -897,7 +892,6 @@ EXPORT_SYMBOL(kobject_register);
EXPORT_SYMBOL(kobject_unregister); EXPORT_SYMBOL(kobject_unregister);
EXPORT_SYMBOL(kobject_get); EXPORT_SYMBOL(kobject_get);
EXPORT_SYMBOL(kobject_put); EXPORT_SYMBOL(kobject_put);
EXPORT_SYMBOL(kobject_add);
EXPORT_SYMBOL(kobject_del); EXPORT_SYMBOL(kobject_del);
EXPORT_SYMBOL(kset_register); EXPORT_SYMBOL(kset_register);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment