Skip to contentSkip to conversation

kobject_add : kill unnecessary warning

PATCH New Dave Young 1 participant 1 message Dec 20, 2007

Subsystems (2)
lore
Share & tools
lore

Dave Young

author
#0 lore raw

PATCH 1/1 kobject_add : kill unnecessary warning

Hi,
I don't know whether you or others have this change or not, if not please consider apply.

Kill the unnecessary warning in kobject_add if sysfs file EEXIST because of there's a similar one in sysfs_add_one

---
kobject.c | 13 ++-----------

1 file changed, 2 insertions(+), 11 deletions(-)
lib/kobject.c +2 -11
diff -upr linux/lib/kobject.c linux.new/lib/kobject.c
@@ -265,19 +265,10 @@ int kobject_add(struct kobject * kobj)
 
 	error = create_dir(kobj);
 	if (error) {
+		printk(KERN_ERR "kobject_add failed for %s (%d)\n",
+			       kobject_name(kobj), error);
 		/* unlink does the kobject_put() for us */
 		unlink(kobj);
-
-		/* be noisy on error issues */
-		if (error == -EEXIST)
-			printk(KERN_ERR "kobject_add failed for %s with "
-			       "-EEXIST, don't try to register things with "
-			       "the same name in the same directory.\n",
-			       kobject_name(kobj));
-		else
-			printk(KERN_ERR "kobject_add failed for %s (%d)\n",
-			       kobject_name(kobj), error);
-		dump_stack();
 	}
 
 	return error;