From 4263cf0fac28122c8381b6f4f9441a43cd93c81f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 14 Sep 2006 01:32:39 -0400 Subject: Input: make input_register_handler() return error codes Signed-off-by: Dmitry Torokhov --- drivers/input/input.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/input/input.c') 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); -- cgit v1.2.1