diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-11-24 04:35:10 (GMT) |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-24 04:35:10 (GMT) |
commit | 153a9df01c0d1ecdc56161c7a0f830325145dd64 (patch) | |
tree | 6645b72a6036bb2491d1e54317009259e41bf568 /drivers/input/mouse | |
parent | ed7b1f6d6ea1054ea4fe293a7fd8015fc3803d93 (diff) | |
download | linux-153a9df01c0d1ecdc56161c7a0f830325145dd64.tar.xz |
Input: handle serio_register_driver() errors
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r-- | drivers/input/mouse/hil_ptr.c | 3 | ||||
-rw-r--r-- | drivers/input/mouse/psmouse-base.c | 8 | ||||
-rw-r--r-- | drivers/input/mouse/sermouse.c | 3 | ||||
-rw-r--r-- | drivers/input/mouse/vsxxxaa.c | 3 |
4 files changed, 9 insertions, 8 deletions
diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c index 4f2b503..bfb174f 100644 --- a/drivers/input/mouse/hil_ptr.c +++ b/drivers/input/mouse/hil_ptr.c @@ -417,8 +417,7 @@ static struct serio_driver hil_ptr_serio_driver = { static int __init hil_ptr_init(void) { - serio_register_driver(&hil_ptr_serio_driver); - return 0; + return serio_register_driver(&hil_ptr_serio_driver); } static void __exit hil_ptr_exit(void) diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 58beca9..e626b1e 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -1524,15 +1524,19 @@ static int psmouse_get_maxproto(char *buffer, struct kernel_param *kp) static int __init psmouse_init(void) { + int err; + kpsmoused_wq = create_singlethread_workqueue("kpsmoused"); if (!kpsmoused_wq) { printk(KERN_ERR "psmouse: failed to create kpsmoused workqueue\n"); return -ENOMEM; } - serio_register_driver(&psmouse_drv); + err = serio_register_driver(&psmouse_drv); + if (err) + destroy_workqueue(kpsmoused_wq); - return 0; + return err; } static void __exit psmouse_exit(void) diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c index 10b51e7..a85d747 100644 --- a/drivers/input/mouse/sermouse.c +++ b/drivers/input/mouse/sermouse.c @@ -351,8 +351,7 @@ static struct serio_driver sermouse_drv = { static int __init sermouse_init(void) { - serio_register_driver(&sermouse_drv); - return 0; + return serio_register_driver(&sermouse_drv); } static void __exit sermouse_exit(void) diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c index ffd0d66..c3d64fc 100644 --- a/drivers/input/mouse/vsxxxaa.c +++ b/drivers/input/mouse/vsxxxaa.c @@ -574,8 +574,7 @@ static struct serio_driver vsxxxaa_drv = { static int __init vsxxxaa_init (void) { - serio_register_driver(&vsxxxaa_drv); - return 0; + return serio_register_driver(&vsxxxaa_drv); } static void __exit |