aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
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
parent68c2a1607cd6dd12427c9566b39756e92708713c (diff)
Input: make input_register_handler() return error codes
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/evbug.c3
-rw-r--r--drivers/input/evdev.c3
-rw-r--r--drivers/input/input.c12
-rw-r--r--drivers/input/joydev.c3
-rw-r--r--drivers/input/mousedev.c21
-rw-r--r--drivers/input/power.c3
-rw-r--r--drivers/input/tsdev.c4
7 files changed, 29 insertions, 20 deletions
diff --git a/drivers/input/evbug.c b/drivers/input/evbug.c
index 1d8ce7a1ec30..5a9653c3128a 100644
--- a/drivers/input/evbug.c
+++ b/drivers/input/evbug.c
@@ -91,8 +91,7 @@ static struct input_handler evbug_handler = {
91 91
92static int __init evbug_init(void) 92static int __init evbug_init(void)
93{ 93{
94 input_register_handler(&evbug_handler); 94 return input_register_handler(&evbug_handler);
95 return 0;
96} 95}
97 96
98static void __exit evbug_exit(void) 97static void __exit evbug_exit(void)
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 154e423167b9..6439f378f6cc 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -695,8 +695,7 @@ static struct input_handler evdev_handler = {
695 695
696static int __init evdev_init(void) 696static int __init evdev_init(void)
697{ 697{
698 input_register_handler(&evdev_handler); 698 return input_register_handler(&evdev_handler);
699 return 0;
700} 699}
701 700
702static void __exit evdev_exit(void) 701static void __exit evdev_exit(void)
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}
1038EXPORT_SYMBOL(input_unregister_device); 1038EXPORT_SYMBOL(input_unregister_device);
1039 1039
1040void input_register_handler(struct input_handler *handler) 1040int 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}
1067EXPORT_SYMBOL(input_register_handler); 1069EXPORT_SYMBOL(input_register_handler);
1068 1070
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 033e3aac92a3..9f3529ad3fda 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -606,8 +606,7 @@ static struct input_handler joydev_handler = {
606 606
607static int __init joydev_init(void) 607static int __init joydev_init(void)
608{ 608{
609 input_register_handler(&joydev_handler); 609 return input_register_handler(&joydev_handler);
610 return 0;
611} 610}
612 611
613static void __exit joydev_exit(void) 612static void __exit joydev_exit(void)
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c
index cd02f1b62b66..a22a74a2a3dc 100644
--- a/drivers/input/mousedev.c
+++ b/drivers/input/mousedev.c
@@ -738,7 +738,12 @@ static int psaux_registered;
738 738
739static int __init mousedev_init(void) 739static int __init mousedev_init(void)
740{ 740{
741 input_register_handler(&mousedev_handler); 741 struct class_device *cdev;
742 int error;
743
744 error = input_register_handler(&mousedev_handler);
745 if (error)
746 return error;
742 747
743 memset(&mousedev_mix, 0, sizeof(struct mousedev)); 748 memset(&mousedev_mix, 0, sizeof(struct mousedev));
744 INIT_LIST_HEAD(&mousedev_mix.list); 749 INIT_LIST_HEAD(&mousedev_mix.list);
@@ -747,12 +752,20 @@ static int __init mousedev_init(void)
747 mousedev_mix.exist = 1; 752 mousedev_mix.exist = 1;
748 mousedev_mix.minor = MOUSEDEV_MIX; 753 mousedev_mix.minor = MOUSEDEV_MIX;
749 754
750 class_device_create(&input_class, NULL, 755 cdev = class_device_create(&input_class, NULL,
751 MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX), NULL, "mice"); 756 MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX), NULL, "mice");
757 if (IS_ERR(cdev)) {
758 input_unregister_handler(&mousedev_handler);
759 return PTR_ERR(cdev);
760 }
752 761
753#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX 762#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
754 if (!(psaux_registered = !misc_register(&psaux_mouse))) 763 error = misc_register(&psaux_mouse);
755 printk(KERN_WARNING "mice: could not misc_register the device\n"); 764 if (error)
765 printk(KERN_WARNING "mice: could not register psaux device, "
766 "error: %d\n", error);
767 else
768 psaux_registered = 1;
756#endif 769#endif
757 770
758 printk(KERN_INFO "mice: PS/2 mouse device common for all mice\n"); 771 printk(KERN_INFO "mice: PS/2 mouse device common for all mice\n");
diff --git a/drivers/input/power.c b/drivers/input/power.c
index 75d018759cd5..ee82464a2fa7 100644
--- a/drivers/input/power.c
+++ b/drivers/input/power.c
@@ -150,8 +150,7 @@ static struct input_handler power_handler = {
150 150
151static int __init power_init(void) 151static int __init power_init(void)
152{ 152{
153 input_register_handler(&power_handler); 153 return input_register_handler(&power_handler);
154 return 0;
155} 154}
156 155
157static void __exit power_exit(void) 156static void __exit power_exit(void)
diff --git a/drivers/input/tsdev.c b/drivers/input/tsdev.c
index 162ee08223a9..a730c461227f 100644
--- a/drivers/input/tsdev.c
+++ b/drivers/input/tsdev.c
@@ -479,9 +479,7 @@ static struct input_handler tsdev_handler = {
479 479
480static int __init tsdev_init(void) 480static int __init tsdev_init(void)
481{ 481{
482 input_register_handler(&tsdev_handler); 482 return input_register_handler(&tsdev_handler);
483 printk(KERN_INFO "ts: Compaq touchscreen protocol output\n");
484 return 0;
485} 483}
486 484
487static void __exit tsdev_exit(void) 485static void __exit tsdev_exit(void)