diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-14 01:32:39 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-09-14 01:32:39 -0400 |
commit | 4263cf0fac28122c8381b6f4f9441a43cd93c81f (patch) | |
tree | 2abdac5c34cf584854677b33e5dcd0e343ee1611 /drivers/input/input.c | |
parent | 68c2a1607cd6dd12427c9566b39756e92708713c (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.c | 12 |
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) | |||
1037 | } | 1037 | } |
1038 | EXPORT_SYMBOL(input_unregister_device); | 1038 | EXPORT_SYMBOL(input_unregister_device); |
1039 | 1039 | ||
1040 | void input_register_handler(struct input_handler *handler) | 1040 | int input_register_handler(struct input_handler *handler) |
1041 | { | 1041 | { |
1042 | struct input_dev *dev; | 1042 | struct input_dev *dev; |
1043 | struct input_handle *handle; | 1043 | struct input_handle *handle; |
1044 | const struct input_device_id *id; | 1044 | const struct input_device_id *id; |
1045 | 1045 | ||
1046 | if (!handler) | ||
1047 | return; | ||
1048 | |||
1049 | INIT_LIST_HEAD(&handler->h_list); | 1046 | INIT_LIST_HEAD(&handler->h_list); |
1050 | 1047 | ||
1051 | if (handler->fops != NULL) | 1048 | if (handler->fops != NULL) { |
1049 | if (input_table[handler->minor >> 5]) | ||
1050 | return -EBUSY; | ||
1051 | |||
1052 | input_table[handler->minor >> 5] = handler; | 1052 | input_table[handler->minor >> 5] = handler; |
1053 | } | ||
1053 | 1054 | ||
1054 | list_add_tail(&handler->node, &input_handler_list); | 1055 | list_add_tail(&handler->node, &input_handler_list); |
1055 | 1056 | ||
@@ -1063,6 +1064,7 @@ void input_register_handler(struct input_handler *handler) | |||
1063 | } | 1064 | } |
1064 | 1065 | ||
1065 | input_wakeup_procfs_readers(); | 1066 | input_wakeup_procfs_readers(); |
1067 | return 0; | ||
1066 | } | 1068 | } |
1067 | EXPORT_SYMBOL(input_register_handler); | 1069 | EXPORT_SYMBOL(input_register_handler); |
1068 | 1070 | ||