Re: 2.6.22-rc2-mm1

From: Cornelia Huck
Date: Tue May 29 2007 - 03:25:59 EST


On Mon, 28 May 2007 00:41:19 +0200,
"Kay Sievers" <kay.sievers@xxxxxxxx> 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@xxxxxxxxxx>

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

Signed-off-by: Cornelia Huck <cornelia.huck@xxxxxxxxxx>

---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/