diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2007-12-18 01:05:35 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-01-24 23:40:38 -0500 |
commit | 9e7bbccd0290e720e0874443932869c55f63d5a8 (patch) | |
tree | 80cc436d79f217809d3f7ecc07d621e5d6e050c3 | |
parent | ac3c8141f62f357169980ec21b7be6d29964a394 (diff) |
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: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | include/linux/kobject.h | 1 | ||||
-rw-r--r-- | lib/kobject.c | 22 |
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 | ||
81 | extern void kobject_init(struct kobject *); | 81 | extern void kobject_init(struct kobject *); |
82 | extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype); | 82 | extern void kobject_init_ng(struct kobject *kobj, struct kobj_type *ktype); |
83 | extern int __must_check kobject_add(struct kobject *); | ||
84 | extern int __must_check kobject_add_ng(struct kobject *kobj, | 83 | extern 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 | ||
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); |