summaryrefslogtreecommitdiff
path: root/drivers/input/input.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2006-09-14 01:32:39 -0400
committerDmitry Torokhov <dtor@insightbb.com>2006-09-14 01:32:39 -0400
commit4263cf0fac28122c8381b6f4f9441a43cd93c81f (patch)
tree2abdac5c34cf584854677b33e5dcd0e343ee1611 /drivers/input/input.c
parent68c2a1607cd6dd12427c9566b39756e92708713c (diff)
Input: make input_register_handler() return error codes
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/input.c')
-rw-r--r--drivers/input/input.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index c3448364cc73..1c8c8a5bc4a9 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -1037,19 +1037,20 @@ void input_unregister_device(struct input_dev *dev)
}
EXPORT_SYMBOL(input_unregister_device);
-void input_register_handler(struct input_handler *handler)
+int input_register_handler(struct input_handler *handler)
{
struct input_dev *dev;
struct input_handle *handle;
const struct input_device_id *id;
- if (!handler)
- return;
-
INIT_LIST_HEAD(&handler->h_list);
- if (handler->fops != NULL)
+ if (handler->fops != NULL) {
+ if (input_table[handler->minor >> 5])
+ return -EBUSY;
+
input_table[handler->minor >> 5] = handler;
+ }
list_add_tail(&handler->node, &input_handler_list);
@@ -1063,6 +1064,7 @@ void input_register_handler(struct input_handler *handler)
}
input_wakeup_procfs_readers();
+ return 0;
}
EXPORT_SYMBOL(input_register_handler);