Driver core: fix regression with SYSFS_DEPRECTATED
PATCH 1/1 Driver core: fix regression with SYSFS_DEPRECTATED
Subject: Driver core: fix SYSF_DEPRECATED breakage for nested classdevs
From: Dmitry Torokhov <[email protected]>
We should only reparent to a class former class devices that form the base of class hierarchy. Nested devices should still grow from their real parents.
Signed-off-by Dmitry Torokhov <[email protected]>
Tested-by Andrey Borzenkov <[email protected]>
Tested-by Anssi Hannula <[email protected]>
---
Linus,
Please consider applying this patch before releasing 2.6.23. It fixes a regression in UDEV/HAL caused by conversion of input devices from class devices to regular devices.
Thanks,
Dmitry
drivers/base/core.c +7 -3
@@ -586,9 +586,13 @@ void device_initialize(struct device *destatic struct kobject *get_device_parent (struct device *dev,struct device *parent) { -/* Set the parent to the class, not the parent device */ -/* this keeps sysfs from having a symlink to make old udevs happy */ -if (dev->class) +/* +* Set the parent to the class, not the parent device +* for topmost devices in class hierarchy. +* This keeps sysfs from having a symlink to make old +* udevs happy +*/ +if (dev->class && (!parent || parent->class != dev->class))return &dev->class->subsys.kobj;else if (parent)return &parent->kobj;
\\