diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-06-02 01:02:52 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-06-30 09:36:17 -0400 |
commit | 819561286b8eca845ce741141a016de2b51e90c7 (patch) | |
tree | 356c3005a238e4945381124307c4ab3ce0de179a /drivers | |
parent | c98122828111d3eeb29bd2d51496e300b4e5356e (diff) |
Input: evbug - identify device by its sysfs ID
This should help with devices that don't set up their phys or name
since sysfs ID is always present.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/evbug.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/input/evbug.c b/drivers/input/evbug.c index 67754c776d88..0353601ac3b5 100644 --- a/drivers/input/evbug.c +++ b/drivers/input/evbug.c | |||
@@ -39,7 +39,7 @@ MODULE_LICENSE("GPL"); | |||
39 | static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) | 39 | static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) |
40 | { | 40 | { |
41 | printk(KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n", | 41 | printk(KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n", |
42 | handle->dev->phys, type, code, value); | 42 | handle->dev->dev.bus_id, type, code, value); |
43 | } | 43 | } |
44 | 44 | ||
45 | static int evbug_connect(struct input_handler *handler, struct input_dev *dev, | 45 | static int evbug_connect(struct input_handler *handler, struct input_dev *dev, |
@@ -64,7 +64,10 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev, | |||
64 | if (error) | 64 | if (error) |
65 | goto err_unregister_handle; | 65 | goto err_unregister_handle; |
66 | 66 | ||
67 | printk(KERN_DEBUG "evbug.c: Connected device: \"%s\", %s\n", dev->name, dev->phys); | 67 | printk(KERN_DEBUG "evbug.c: Connected device: %s (%s at %s)\n", |
68 | dev->dev.bus_id, | ||
69 | dev->name ?: "unknown", | ||
70 | dev->phys ?: "unknown"); | ||
68 | 71 | ||
69 | return 0; | 72 | return 0; |
70 | 73 | ||
@@ -77,7 +80,8 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev, | |||
77 | 80 | ||
78 | static void evbug_disconnect(struct input_handle *handle) | 81 | static void evbug_disconnect(struct input_handle *handle) |
79 | { | 82 | { |
80 | printk(KERN_DEBUG "evbug.c: Disconnected device: %s\n", handle->dev->phys); | 83 | printk(KERN_DEBUG "evbug.c: Disconnected device: %s\n", |
84 | handle->dev->dev.bus_id); | ||
81 | 85 | ||
82 | input_close_device(handle); | 86 | input_close_device(handle); |
83 | input_unregister_handle(handle); | 87 | input_unregister_handle(handle); |