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/mousedev.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/mousedev.c')
-rw-r--r-- | drivers/input/mousedev.c | 21 |
1 files changed, 17 insertions, 4 deletions
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 | ||
739 | static int __init mousedev_init(void) | 739 | static 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"); |