lkml.org 
[lkml]   [2007]   [May]   [29]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateTue, 29 May 2007 09:25:43 +0200
FromCornelia Huck <>
SubjectRe: 2.6.22-rc2-mm1
On Mon, 28 May 2007 00:41:19 +0200,
"Kay Sievers" <kay.sievers@vrfy.org> wrote:

> Cornelia,
> in the patch is:
>   +	if (dev->kobj.parent == &dev->class->subsys.kobj)
>   +		return 0;
> 
> which will skip the creation of the "device"-link, right?

...and this is certainly broken. Argl.

Could those folks that had trouble with this kernel check out whether
the following patch helps?


From: Cornelia Huck <cornelia.huck@de.ibm.com>

Fix check when to create certain symlinks (the device link and some
compatible links).

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

---
 drivers/base/core.c |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
--- linux-2.6.orig/drivers/base/core.c
+++ linux-2.6/drivers/base/core.c
@@ -657,12 +657,12 @@ static int device_add_class_symlinks(str
 	 * If this is not a "fake" compatible device, then create the
 	 * symlink from the class to the device.
 	 */
-	if (dev->kobj.parent == &dev->class->subsys.kobj)
-		return 0;
-	error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
-				  dev->bus_id);
-	if (error)
-		goto out_subsys;
+	if (dev->kobj.parent != &dev->class->subsys.kobj) {
+		error = sysfs_create_link(&dev->class->subsys.kobj, &dev->kobj,
+					  dev->bus_id);
+		if (error)
+			goto out_subsys;
+	}
 	if (dev->parent) {
 		error = sysfs_create_link(&dev->kobj, &dev->parent->kobj,
 					  "device");
@@ -689,7 +689,8 @@ out_device:
 		sysfs_remove_link(&dev->kobj, "device");
 #endif
 out_busid:
-	sysfs_remove_link(&dev->class->subsys.kobj, dev->bus_id);
+	if (dev->kobj.parent != &dev->class->subsys.kobj)
+		sysfs_remove_link(&dev->class->subsys.kobj, dev->bus_id);
 out_subsys:
 	sysfs_remove_link(&dev->kobj, "subsystem");
 out:
@@ -712,7 +713,8 @@ static void device_remove_class_symlinks
 #endif
 		sysfs_remove_link(&dev->kobj, "device");
 	}
-	sysfs_remove_link(&dev->class->subsys.kobj, dev->bus_id);
+	if (dev->kobj.parent != &dev->class->subsys.kobj)
+		sysfs_remove_link(&dev->class->subsys.kobj, dev->bus_id);
 	sysfs_remove_link(&dev->kobj, "subsystem");
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-05-29 07:29    [from the cache]
©2003-2008