public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Aaron Gyes <floam@sh.nu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: 2.6.14-rc4-mm1: udev/sysfs wierdness
Date: Mon, 17 Oct 2005 23:57:05 -0700	[thread overview]
Message-ID: <20051018065705.GA11858@kroah.com> (raw)
In-Reply-To: <20051018055003.GA10488@kroah.com>

On Mon, Oct 17, 2005 at 10:50:03PM -0700, Greg KH wrote:
> On Mon, Oct 17, 2005 at 09:35:13PM -0700, Aaron Gyes wrote:
> > For some reason this rule stopped working:
> > 
> > KERNEL=="event*", SYSFS{manufacturer}="Logitech", SYSFS{product}="USB
> > Receiver", NAME="input/mx1000", MODE="0644"
> > 
> > Did stuff in /sys/ change? Do I need to change all my rules to make up
> > for this? udevs fault? I do have the correct /dev/input/event0 node.
> 
> You have that node?  That's a good start :)
> 
> I think the "name" might have changed, it looks like I messed that up
> somehow.  What does:
> 	 udevinfo -p /sys/class/input/input0/event0/ -a
> 
> show (or whatever that sysfs path is.)
> 
> Oops, heh, that dies on my box too.  Ok, I think that's the issue,
> sorry.  I'm working on it...

Can you try the patch below to see if that fixes the issue?  That should
keep udevinfo from dieing.

thanks,

greg k-h


---
 drivers/input/input.c |   19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

--- gregkh-2.6.orig/drivers/input/input.c
+++ gregkh-2.6/drivers/input/input.c
@@ -522,17 +522,22 @@ static ssize_t input_dev_show_##name(str
 	up(&input_dev->sem);							\
 										\
 	return retval;								\
-}
+}										\
+static CLASS_DEVICE_ATTR(name, S_IRUGO, input_dev_show_##name, NULL);
 
 INPUT_DEV_STRING_ATTR_SHOW(name);
 INPUT_DEV_STRING_ATTR_SHOW(phys);
 INPUT_DEV_STRING_ATTR_SHOW(uniq);
 
-static struct class_device_attribute input_dev_attrs[] = {
-	__ATTR(name, S_IRUGO, input_dev_show_name, NULL),
-	__ATTR(phys, S_IRUGO, input_dev_show_phys, NULL),
-	__ATTR(uniq, S_IRUGO, input_dev_show_uniq, NULL),
-	__ATTR_NULL
+static struct attribute *input_dev_attrs[] = {
+	&class_device_attr_name.attr,
+	&class_device_attr_phys.attr,
+	&class_device_attr_uniq.attr,
+	NULL
+};
+
+static struct attribute_group input_dev_group = {
+	.attrs	= input_dev_attrs,
 };
 
 #define INPUT_DEV_ID_ATTR(name)							\
@@ -694,7 +699,6 @@ struct class input_class = {
 	.name			= "input",
 	.release		= input_dev_release,
 	.hotplug		= input_dev_hotplug,
-	.class_dev_attrs	= input_dev_attrs,
 };
 
 struct input_dev *input_allocate_device(void)
@@ -732,6 +736,7 @@ static void input_register_classdevice(s
 	kfree(path);
 
 	class_device_add(&dev->cdev);
+	sysfs_create_group(&dev->cdev.kobj, &input_dev_group);
 	sysfs_create_group(&dev->cdev.kobj, &input_dev_id_attr_group);
 	sysfs_create_group(&dev->cdev.kobj, &input_dev_caps_attr_group);
 }

  reply	other threads:[~2005-10-18  6:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-18  4:35 2.6.14-rc4-mm1: udev/sysfs wierdness Aaron Gyes
2005-10-18  5:50 ` Greg KH
2005-10-18  6:57   ` Greg KH [this message]
2005-10-18  8:31     ` Mathieu Segaud
2005-10-19  3:44       ` Greg KH
2005-10-19  6:00         ` Aaron Gyes
2005-10-19 23:44           ` Greg KH
2005-10-20  3:34             ` Aaron Gyes
2005-10-20  3:50               ` Greg KH
2005-10-19  8:21         ` Mathieu Segaud

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=20051018065705.GA11858@kroah.com \
    --to=greg@kroah.com \
    --cc=floam@sh.nu \
    --cc=linux-kernel@vger.kernel.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