mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-12 08:09:56 +00:00
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>
This commit is contained in:
parent
c981228281
commit
819561286b
@ -39,7 +39,7 @@ MODULE_LICENSE("GPL");
|
|||||||
static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
|
static void evbug_event(struct input_handle *handle, unsigned int type, unsigned int code, int value)
|
||||||
{
|
{
|
||||||
printk(KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n",
|
printk(KERN_DEBUG "evbug.c: Event. Dev: %s, Type: %d, Code: %d, Value: %d\n",
|
||||||
handle->dev->phys, type, code, value);
|
handle->dev->dev.bus_id, type, code, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int evbug_connect(struct input_handler *handler, struct input_dev *dev,
|
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,
|
|||||||
if (error)
|
if (error)
|
||||||
goto err_unregister_handle;
|
goto err_unregister_handle;
|
||||||
|
|
||||||
printk(KERN_DEBUG "evbug.c: Connected device: \"%s\", %s\n", dev->name, dev->phys);
|
printk(KERN_DEBUG "evbug.c: Connected device: %s (%s at %s)\n",
|
||||||
|
dev->dev.bus_id,
|
||||||
|
dev->name ?: "unknown",
|
||||||
|
dev->phys ?: "unknown");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -77,7 +80,8 @@ static int evbug_connect(struct input_handler *handler, struct input_dev *dev,
|
|||||||
|
|
||||||
static void evbug_disconnect(struct input_handle *handle)
|
static void evbug_disconnect(struct input_handle *handle)
|
||||||
{
|
{
|
||||||
printk(KERN_DEBUG "evbug.c: Disconnected device: %s\n", handle->dev->phys);
|
printk(KERN_DEBUG "evbug.c: Disconnected device: %s\n",
|
||||||
|
handle->dev->dev.bus_id);
|
||||||
|
|
||||||
input_close_device(handle);
|
input_close_device(handle);
|
||||||
input_unregister_handle(handle);
|
input_unregister_handle(handle);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user