DSS2: DSI: decrease sync timeout from 60s to 2s
[pandora-kernel.git] / lib / kobject.c
index 7444015..fbf0ae2 100644 (file)
@@ -164,9 +164,8 @@ static int kobject_add_internal(struct kobject *kobj)
                return -ENOENT;
 
        if (!kobj->name || !kobj->name[0]) {
-               pr_debug("kobject: (%p): attempted to be registered with empty "
+               WARN(1, "kobject: (%p): attempted to be registered with empty "
                         "name!\n", kobj);
-               WARN_ON(1);
                return -EINVAL;
        }
 
@@ -224,8 +223,7 @@ static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt,
                return -ENOMEM;
 
        /* ewww... some of these buggers have '/' in the name ... */
-       s = strchr(kobj->name, '/');
-       if (s)
+       while ((s = strchr(kobj->name, '/')))
                s[0] = '!';
 
        kfree(old_name);
@@ -583,12 +581,10 @@ static void kobject_release(struct kref *kref)
 void kobject_put(struct kobject *kobj)
 {
        if (kobj) {
-               if (!kobj->state_initialized) {
-                       printk(KERN_WARNING "kobject: '%s' (%p): is not "
+               if (!kobj->state_initialized)
+                       WARN(1, KERN_WARNING "kobject: '%s' (%p): is not "
                               "initialized, yet kobject_put() is being "
                               "called.\n", kobject_name(kobj), kobj);
-                       WARN_ON(1);
-               }
                kref_put(&kobj->kref, kobject_release);
        }
 }