From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Anssi Hannula <anssi.hannula@gmail.com>,
Andrey Borzenkov <arvidjaar@mail.ru>, Greg KH <greg@kroah.com>,
Kay Sievers <kay.sievers@vrfy.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH for 2.6.23] Driver core: fix regression with SYSFS_DEPRECTATED
Date: Sun, 7 Oct 2007 12:22:21 -0400 [thread overview]
Message-ID: <200710071222.22218.dmitry.torokhov@gmail.com> (raw)
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;
\\
reply other threads:[~2007-10-07 16:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200710071222.22218.dmitry.torokhov@gmail.com \
--to=dmitry.torokhov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=anssi.hannula@gmail.com \
--cc=arvidjaar@mail.ru \
--cc=greg@kroah.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome