All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH for 2.6.23] Driver core: fix regression with SYSFS_DEPRECTATED
@ 2007-10-07 16:22 Dmitry Torokhov
  0 siblings, 0 replies; only message in thread
From: Dmitry Torokhov @ 2007-10-07 16:22 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Andrew Morton, Anssi Hannula, Andrey Borzenkov, Greg KH,
	Kay Sievers, LKML

Subject: Driver core: fix SYSF_DEPRECATED breakage for nested classdevs
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

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 <dtor@mail.ru>
Tested-by: Andrey Borzenkov <arvidjaar@mail.ru>
Tested-by: Anssi Hannula <anssi.hannula@gmail.com>
---

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

Index: linux/drivers/base/core.c
===================================================================
--- linux.orig/drivers/base/core.c
+++ linux/drivers/base/core.c
@@ -586,9 +586,13 @@ void device_initialize(struct device *de
 static 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;

\\

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-07 16:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-07 16:22 [PATCH for 2.6.23] Driver core: fix regression with SYSFS_DEPRECTATED Dmitry Torokhov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.