Re: borked sysfs system devices in 2.5.72

Patrick Mochel (
Tue, 17 Jun 2003 15:54:04 -0700 (PDT)

> Look in subsys_attr_show(). It is being passed a kobject, which is a
> member of a "struct sys_device". We can tell this because I printed out
> the address of the sys device in sys_device_register(). A to_subsys()
> is being performed on that object, which is wrong, because the kobject
> is not a member of a "struct subsystem".

My question was how the hell it was getting there in the first place, and
I see that the type of the object isn't getting set properly, so it
defaults to treat it as a struct subsystem.

Could you please try the following patch, and let me know if it works?



===== drivers/base/sys.c 1.25 vs edited =====
--- 1.25/drivers/base/sys.c Mon Jun 16 10:07:04 2003
+++ edited/drivers/base/sys.c Tue Jun 17 15:50:48 2003
@@ -170,6 +172,9 @@

/* Make sure the kset is set */
sysdev->kobj.kset = &cls->kset;
+ /* But make sure we point to the right type for sysfs translation */
+ sysdev->kobj.ktype = &ktype_sysdev;

/* set the kobject name */

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at