Commit 051b2fea authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Greg Kroah-Hartman

[PATCH] Input: show sysfs path in /proc/bus/input/devices

Input: show sysfs path in /proc/bus/input/devices

Show that sysfs and phys path are different objects.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 5ebdcbc2
...@@ -475,17 +475,21 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int ...@@ -475,17 +475,21 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
{ {
struct input_dev *dev; struct input_dev *dev;
struct input_handle *handle; struct input_handle *handle;
const char *path;
off_t at = 0; off_t at = 0;
int i, len, cnt = 0; int i, len, cnt = 0;
list_for_each_entry(dev, &input_dev_list, node) { list_for_each_entry(dev, &input_dev_list, node) {
path = dev->dynalloc ? kobject_get_path(&dev->cdev.kobj, GFP_KERNEL) : NULL;
len = sprintf(buf, "I: Bus=%04x Vendor=%04x Product=%04x Version=%04x\n", len = sprintf(buf, "I: Bus=%04x Vendor=%04x Product=%04x Version=%04x\n",
dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version); dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version);
len += sprintf(buf + len, "N: Name=\"%s\"\n", dev->name ? dev->name : ""); len += sprintf(buf + len, "N: Name=\"%s\"\n", dev->name ? dev->name : "");
len += sprintf(buf + len, "P: Phys=%s\n", dev->phys ? dev->phys : ""); len += sprintf(buf + len, "P: Phys=%s\n", dev->phys ? dev->phys : "");
len += sprintf(buf + len, "S: Sysfs=%s\n", path ? path : "");
len += sprintf(buf + len, "H: Handlers="); len += sprintf(buf + len, "H: Handlers=");
list_for_each_entry(handle, &dev->h_list, d_node) list_for_each_entry(handle, &dev->h_list, d_node)
...@@ -516,6 +520,8 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int ...@@ -516,6 +520,8 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
if (cnt >= count) if (cnt >= count)
break; break;
} }
kfree(path);
} }
if (&dev->node == &input_dev_list) if (&dev->node == &input_dev_list)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment