diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kobject.c | 22 |
1 files changed, 8 insertions, 14 deletions
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 | ||
150 | static void unlink(struct kobject * kobj) | 150 | static 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 | /** | 164 | static int kobject_add_internal(struct kobject *kobj) |
165 | * kobject_add - add an object to the hierarchy. | ||
166 | * @kobj: object. | ||
167 | */ | ||
168 | |||
169 | int 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 | ||
743 | int kset_add(struct kset * k) | 738 | int 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); | |||
897 | EXPORT_SYMBOL(kobject_unregister); | 892 | EXPORT_SYMBOL(kobject_unregister); |
898 | EXPORT_SYMBOL(kobject_get); | 893 | EXPORT_SYMBOL(kobject_get); |
899 | EXPORT_SYMBOL(kobject_put); | 894 | EXPORT_SYMBOL(kobject_put); |
900 | EXPORT_SYMBOL(kobject_add); | ||
901 | EXPORT_SYMBOL(kobject_del); | 895 | EXPORT_SYMBOL(kobject_del); |
902 | 896 | ||
903 | EXPORT_SYMBOL(kset_register); | 897 | EXPORT_SYMBOL(kset_register); |