aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/kobject.h1
-rw-r--r--lib/kobject.c22
2 files changed, 8 insertions, 15 deletions
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index bb6868475edb..8b0aa715fa2f 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -80,7 +80,6 @@ static inline const char * kobject_name(const struct kobject * kobj)
80 80
81extern void kobject_init(struct kobject *); 81extern void kobject_init(struct kobject *);
82extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype); 82extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype);
83extern int __must_check kobject_add(struct kobject *);
84extern int __must_check kobject_add_ng(struct kobject *kobj, 83extern int __must_check kobject_add_ng(struct kobject *kobj,
85 struct kobject *parent, 84 struct kobject *parent,
86 const char *fmt, ...); 85 const char *fmt, ...);
diff --git a/lib/kobject.c b/lib/kobject.c
index 493e991abb1b..d04789fa4da9 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -144,7 +144,7 @@ void kobject_init(struct kobject * kobj)
144 * Remove the kobject from the kset list and decrement 144 * Remove the kobject from the kset list and decrement
145 * its parent's refcount. 145 * its parent's refcount.
146 * This is separated out, so we can use it in both 146 * This is separated out, so we can use it in both
147 * kobject_del() and kobject_add() on error. 147 * kobject_del() and kobject_add_internal() on error.
148 */ 148 */
149 149
150static void unlink(struct kobject * kobj) 150static void unlink(struct kobject * kobj)
@@ -161,12 +161,7 @@ static void unlink(struct kobject * kobj)
161 kobject_put(parent); 161 kobject_put(parent);
162} 162}
163 163
164/** 164static int kobject_add_internal(struct kobject *kobj)
165 * kobject_add - add an object to the hierarchy.
166 * @kobj: object.
167 */
168
169int kobject_add(struct kobject * kobj)
170{ 165{
171 int error = 0; 166 int error = 0;
172 struct kobject * parent; 167 struct kobject * parent;
@@ -215,13 +210,13 @@ int kobject_add(struct kobject * kobj)
215 210
216 /* be noisy on error issues */ 211 /* be noisy on error issues */
217 if (error == -EEXIST) 212 if (error == -EEXIST)
218 printk(KERN_ERR "kobject_add failed for %s with " 213 printk(KERN_ERR "%s failed for %s with "
219 "-EEXIST, don't try to register things with " 214 "-EEXIST, don't try to register things with "
220 "the same name in the same directory.\n", 215 "the same name in the same directory.\n",
221 kobject_name(kobj)); 216 __FUNCTION__, kobject_name(kobj));
222 else 217 else
223 printk(KERN_ERR "kobject_add failed for %s (%d)\n", 218 printk(KERN_ERR "%s failed for %s (%d)\n",
224 kobject_name(kobj), error); 219 __FUNCTION__, kobject_name(kobj), error);
225 dump_stack(); 220 dump_stack();
226 } 221 }
227 222
@@ -351,7 +346,7 @@ static int kobject_add_varg(struct kobject *kobj, struct kobject *parent,
351 return retval; 346 return retval;
352 } 347 }
353 kobj->parent = parent; 348 kobj->parent = parent;
354 return kobject_add(kobj); 349 return kobject_add_internal(kobj);
355} 350}
356 351
357/** 352/**
@@ -742,7 +737,7 @@ struct sysfs_ops kobj_sysfs_ops = {
742 737
743int kset_add(struct kset * k) 738int kset_add(struct kset * k)
744{ 739{
745 return kobject_add(&k->kobj); 740 return kobject_add_internal(&k->kobj);
746} 741}
747 742
748 743
@@ -897,7 +892,6 @@ EXPORT_SYMBOL(kobject_register);
897EXPORT_SYMBOL(kobject_unregister); 892EXPORT_SYMBOL(kobject_unregister);
898EXPORT_SYMBOL(kobject_get); 893EXPORT_SYMBOL(kobject_get);
899EXPORT_SYMBOL(kobject_put); 894EXPORT_SYMBOL(kobject_put);
900EXPORT_SYMBOL(kobject_add);
901EXPORT_SYMBOL(kobject_del); 895EXPORT_SYMBOL(kobject_del);
902 896
903EXPORT_SYMBOL(kset_register); 897EXPORT_SYMBOL(kset_register);