aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kobject.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-09-24 03:56:20 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-24 03:56:20 -0400
commitebdd90a8cb2e3963f55499850f02ce6003558b55 (patch)
treed153f917ed41d257ddafa22f9cc2201bfddf8f9c /lib/kobject.c
parent3c9339049df5cc3a468c11de6c4101a1ea8c3d83 (diff)
parent72d31053f62c4bc464c2783974926969614a8649 (diff)
Merge commit 'v2.6.27-rc7' into x86/pebs
Diffstat (limited to 'lib/kobject.c')
-rw-r--r--lib/kobject.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/kobject.c b/lib/kobject.c
index 744401571ed7..fbf0ae282376 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -164,9 +164,8 @@ static int kobject_add_internal(struct kobject *kobj)
164 return -ENOENT; 164 return -ENOENT;
165 165
166 if (!kobj->name || !kobj->name[0]) { 166 if (!kobj->name || !kobj->name[0]) {
167 pr_debug("kobject: (%p): attempted to be registered with empty " 167 WARN(1, "kobject: (%p): attempted to be registered with empty "
168 "name!\n", kobj); 168 "name!\n", kobj);
169 WARN_ON(1);
170 return -EINVAL; 169 return -EINVAL;
171 } 170 }
172 171
@@ -224,8 +223,7 @@ static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
224 return -ENOMEM; 223 return -ENOMEM;
225 224
226 /* ewww... some of these buggers have '/' in the name ... */ 225 /* ewww... some of these buggers have '/' in the name ... */
227 s = strchr(kobj->name, '/'); 226 while ((s = strchr(kobj->name, '/')))
228 if (s)
229 s[0] = '!'; 227 s[0] = '!';
230 228
231 kfree(old_name); 229 kfree(old_name);
@@ -583,12 +581,10 @@ static void kobject_release(struct kref *kref)
583void kobject_put(struct kobject *kobj) 581void kobject_put(struct kobject *kobj)
584{ 582{
585 if (kobj) { 583 if (kobj) {
586 if (!kobj->state_initialized) { 584 if (!kobj->state_initialized)
587 printk(KERN_WARNING "kobject: '%s' (%p): is not " 585 WARN(1, KERN_WARNING "kobject: '%s' (%p): is not "
588 "initialized, yet kobject_put() is being " 586 "initialized, yet kobject_put() is being "
589 "called.\n", kobject_name(kobj), kobj); 587 "called.\n", kobject_name(kobj), kobj);
590 WARN_ON(1);
591 }
592 kref_put(&kobj->kref, kobject_release); 588 kref_put(&kobj->kref, kobject_release);
593 } 589 }
594} 590}