aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mousedev.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/mousedev.c
parentInput: remove cruft that was needed for transition to sysfs (diff)
downloadlinux-dev-4263cf0fac28122c8381b6f4f9441a43cd93c81f.tar.xz
linux-dev-4263cf0fac28122c8381b6f4f9441a43cd93c81f.zip
Input: make input_register_handler() return error codes
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to '')
-rw-r--r--drivers/input/mousedev.c21
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;
static int __init mousedev_init(void)
{
- input_register_handler(&mousedev_handler);
+ struct class_device *cdev;
+ int error;
+
+ error = input_register_handler(&mousedev_handler);
+ if (error)
+ return error;
memset(&mousedev_mix, 0, sizeof(struct mousedev));
INIT_LIST_HEAD(&mousedev_mix.list);
@@ -747,12 +752,20 @@ static int __init mousedev_init(void)
mousedev_mix.exist = 1;
mousedev_mix.minor = MOUSEDEV_MIX;
- class_device_create(&input_class, NULL,
+ cdev = class_device_create(&input_class, NULL,
MKDEV(INPUT_MAJOR, MOUSEDEV_MINOR_BASE + MOUSEDEV_MIX), NULL, "mice");
+ if (IS_ERR(cdev)) {
+ input_unregister_handler(&mousedev_handler);
+ return PTR_ERR(cdev);
+ }
#ifdef CONFIG_INPUT_MOUSEDEV_PSAUX
- if (!(psaux_registered = !misc_register(&psaux_mouse)))
- printk(KERN_WARNING "mice: could not misc_register the device\n");
+ error = misc_register(&psaux_mouse);
+ if (error)
+ printk(KERN_WARNING "mice: could not register psaux device, "
+ "error: %d\n", error);
+ else
+ psaux_registered = 1;
#endif
printk(KERN_INFO "mice: PS/2 mouse device common for all mice\n");