diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/kobject.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index efe67fa96a71..36668c8c3ea1 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -194,6 +194,17 @@ int kobject_add(struct kobject * kobj) | |||
194 | unlink(kobj); | 194 | unlink(kobj); |
195 | if (parent) | 195 | if (parent) |
196 | kobject_put(parent); | 196 | kobject_put(parent); |
197 | |||
198 | /* be noisy on error issues */ | ||
199 | if (error == -EEXIST) | ||
200 | printk("kobject_add failed for %s with -EEXIST, " | ||
201 | "don't try to register things with the " | ||
202 | "same name in the same directory.\n", | ||
203 | kobject_name(kobj)); | ||
204 | else | ||
205 | printk("kobject_add failed for %s (%d)\n", | ||
206 | kobject_name(kobj), error); | ||
207 | dump_stack(); | ||
197 | } | 208 | } |
198 | 209 | ||
199 | return error; | 210 | return error; |
@@ -207,18 +218,13 @@ int kobject_add(struct kobject * kobj) | |||
207 | 218 | ||
208 | int kobject_register(struct kobject * kobj) | 219 | int kobject_register(struct kobject * kobj) |
209 | { | 220 | { |
210 | int error = 0; | 221 | int error = -EINVAL; |
211 | if (kobj) { | 222 | if (kobj) { |
212 | kobject_init(kobj); | 223 | kobject_init(kobj); |
213 | error = kobject_add(kobj); | 224 | error = kobject_add(kobj); |
214 | if (error) { | 225 | if (!error) |
215 | printk("kobject_register failed for %s (%d)\n", | ||
216 | kobject_name(kobj),error); | ||
217 | dump_stack(); | ||
218 | } else | ||
219 | kobject_uevent(kobj, KOBJ_ADD); | 226 | kobject_uevent(kobj, KOBJ_ADD); |
220 | } else | 227 | } |
221 | error = -EINVAL; | ||
222 | return error; | 228 | return error; |
223 | } | 229 | } |
224 | 230 | ||