Re: linux-2.6.23-git3: Many sysfs-related warnings in dmesg

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Larry Finger <Larry.Finger@...>
Cc: Greg Kroah-Hartman <gregkh@...>, LKML <linux-kernel@...>
Date: Friday, October 26, 2007 - 2:07 pm

On Fri, 2007-10-26 at 12:05 -0500, Larry Finger wrote:

Care to try this? Seems like a silly bug in the core if
SYSFS_DEPRECATED=y. That's why we didn't catch this earlier, sorry.

Thanks a lot for the help,
Kay



From: Kay Sievers <kay.sievers@vrfy.org>
Subject: Driver Core: fix bug in device_rename() for SYSFS_DEPRECATED=y

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
---

diff --git a/drivers/base/core.c b/drivers/base/core.c
index c134341..3f4d6aa 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1228,18 +1228,18 @@ int device_rename(struct device *dev, char *new_name)
 			sysfs_remove_link(&dev->parent->kobj, old_class_name);
 		}
 	}
-#endif
-
+#else
 	if (dev->class) {
 		sysfs_remove_link(&dev->class->subsys.kobj, old_device_name);
 		error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
 					  dev->bus_id);
 		if (error) {
-			/* Uh... how to unravel this if restoring can fail? */
 			dev_err(dev, "%s: sysfs_create_symlink failed (%d)\n",
 				__FUNCTION__, error);
 		}
 	}
+#endif
+
 out:
 	put_device(dev);
 

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: linux-2.6.23-git3: Many sysfs-related warnings in dmesg, Kay Sievers, (Fri Oct 26, 2:07 pm)