Merge tag 'stable/for-linus-3.4-rc3-tag' of git://git.kernel.org/pub/scm/linux/kernel...
[firefly-linux-kernel-4.4.55.git] / lib / kobject.c
index c33d7a18d635aea9014cf4a09984155b9f0df66d..aeefa8bc8b1c2dac1493703ff2f209ce894938f9 100644 (file)
@@ -14,7 +14,7 @@
 
 #include <linux/kobject.h>
 #include <linux/string.h>
-#include <linux/module.h>
+#include <linux/export.h>
 #include <linux/stat.h>
 #include <linux/slab.h>
 
@@ -192,14 +192,14 @@ static int kobject_add_internal(struct kobject *kobj)
 
                /* be noisy on error issues */
                if (error == -EEXIST)
-                       printk(KERN_ERR "%s failed for %s with "
-                              "-EEXIST, don't try to register things with "
-                              "the same name in the same directory.\n",
-                              __func__, kobject_name(kobj));
+                       WARN(1, "%s failed for %s with "
+                            "-EEXIST, don't try to register things with "
+                            "the same name in the same directory.\n",
+                            __func__, kobject_name(kobj));
                else
-                       printk(KERN_ERR "%s failed for %s (%d)\n",
-                              __func__, kobject_name(kobj), error);
-               dump_stack();
+                       WARN(1, "%s failed for %s (error: %d parent: %s)\n",
+                            __func__, kobject_name(kobj), error,
+                            parent ? kobject_name(parent) : "'none'");
        } else
                kobj->state_in_sysfs = 1;