diff options
Diffstat (limited to 'lib/kobject.c')
-rw-r--r-- | lib/kobject.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/kobject.c b/lib/kobject.c index 744401571ed7..bd732ffebc85 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 | ||
@@ -583,12 +582,10 @@ static void kobject_release(struct kref *kref) | |||
583 | void kobject_put(struct kobject *kobj) | 582 | void kobject_put(struct kobject *kobj) |
584 | { | 583 | { |
585 | if (kobj) { | 584 | if (kobj) { |
586 | if (!kobj->state_initialized) { | 585 | if (!kobj->state_initialized) |
587 | printk(KERN_WARNING "kobject: '%s' (%p): is not " | 586 | WARN(1, KERN_WARNING "kobject: '%s' (%p): is not " |
588 | "initialized, yet kobject_put() is being " | 587 | "initialized, yet kobject_put() is being " |
589 | "called.\n", kobject_name(kobj), kobj); | 588 | "called.\n", kobject_name(kobj), kobj); |
590 | WARN_ON(1); | ||
591 | } | ||
592 | kref_put(&kobj->kref, kobject_release); | 589 | kref_put(&kobj->kref, kobject_release); |
593 | } | 590 | } |
594 | } | 591 | } |