Input: handle serio_register_driver() errors

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
Akinobu Mita 2006-11-23 23:35:10 -05:00 committed by Dmitry Torokhov
parent ed7b1f6d6e
commit 153a9df01c
26 changed files with 41 additions and 53 deletions

View file

@ -467,13 +467,21 @@ int iforce_init_device(struct iforce *iforce)
static int __init iforce_init(void)
{
int err = 0;
#ifdef CONFIG_JOYSTICK_IFORCE_USB
usb_register(&iforce_usb_driver);
err = usb_register(&iforce_usb_driver);
if (err)
return err;
#endif
#ifdef CONFIG_JOYSTICK_IFORCE_232
serio_register_driver(&iforce_serio_drv);
err = serio_register_driver(&iforce_serio_drv);
#ifdef CONFIG_JOYSTICK_IFORCE_USB
if (err)
usb_deregister(&iforce_usb_driver);
#endif
return 0;
#endif
return err;
}
static void __exit iforce_exit(void)

View file

@ -231,8 +231,7 @@ static struct serio_driver magellan_drv = {
static int __init magellan_init(void)
{
serio_register_driver(&magellan_drv);
return 0;
return serio_register_driver(&magellan_drv);
}
static void __exit magellan_exit(void)

View file

@ -300,8 +300,7 @@ static struct serio_driver spaceball_drv = {
static int __init spaceball_init(void)
{
serio_register_driver(&spaceball_drv);
return 0;
return serio_register_driver(&spaceball_drv);
}
static void __exit spaceball_exit(void)

View file

@ -246,8 +246,7 @@ static struct serio_driver spaceorb_drv = {
static int __init spaceorb_init(void)
{
serio_register_driver(&spaceorb_drv);
return 0;
return serio_register_driver(&spaceorb_drv);
}
static void __exit spaceorb_exit(void)

View file

@ -216,8 +216,7 @@ static struct serio_driver stinger_drv = {
static int __init stinger_init(void)
{
serio_register_driver(&stinger_drv);
return 0;
return serio_register_driver(&stinger_drv);
}
static void __exit stinger_exit(void)

View file

@ -269,8 +269,7 @@ static struct serio_driver twidjoy_drv = {
static int __init twidjoy_init(void)
{
serio_register_driver(&twidjoy_drv);
return 0;
return serio_register_driver(&twidjoy_drv);
}
static void __exit twidjoy_exit(void)

View file

@ -224,8 +224,7 @@ static struct serio_driver warrior_drv = {
static int __init warrior_init(void)
{
serio_register_driver(&warrior_drv);
return 0;
return serio_register_driver(&warrior_drv);
}
static void __exit warrior_exit(void)

View file

@ -1389,8 +1389,7 @@ static ssize_t atkbd_show_err_count(struct atkbd *atkbd, char *buf)
static int __init atkbd_init(void)
{
serio_register_driver(&atkbd_drv);
return 0;
return serio_register_driver(&atkbd_drv);
}
static void __exit atkbd_exit(void)

View file

@ -381,8 +381,7 @@ struct serio_driver hil_kbd_serio_drv = {
static int __init hil_kbd_init(void)
{
serio_register_driver(&hil_kbd_serio_drv);
return 0;
return serio_register_driver(&hil_kbd_serio_drv);
}
static void __exit hil_kbd_exit(void)

View file

@ -758,8 +758,7 @@ static struct serio_driver lkkbd_drv = {
static int __init
lkkbd_init (void)
{
serio_register_driver(&lkkbd_drv);
return 0;
return serio_register_driver(&lkkbd_drv);
}
static void __exit

View file

@ -169,8 +169,7 @@ static struct serio_driver nkbd_drv = {
static int __init nkbd_init(void)
{
serio_register_driver(&nkbd_drv);
return 0;
return serio_register_driver(&nkbd_drv);
}
static void __exit nkbd_exit(void)

View file

@ -173,8 +173,7 @@ static struct serio_driver skbd_drv = {
static int __init skbd_init(void)
{
serio_register_driver(&skbd_drv);
return 0;
return serio_register_driver(&skbd_drv);
}
static void __exit skbd_exit(void)

View file

@ -352,8 +352,7 @@ static struct serio_driver sunkbd_drv = {
static int __init sunkbd_init(void)
{
serio_register_driver(&sunkbd_drv);
return 0;
return serio_register_driver(&sunkbd_drv);
}
static void __exit sunkbd_exit(void)

View file

@ -174,8 +174,7 @@ static struct serio_driver xtkbd_drv = {
static int __init xtkbd_init(void)
{
serio_register_driver(&xtkbd_drv);
return 0;
return serio_register_driver(&xtkbd_drv);
}
static void __exit xtkbd_exit(void)

View file

@ -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)

View file

@ -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)

View file

@ -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)

View file

@ -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

View file

@ -389,8 +389,7 @@ static struct serio_driver serio_raw_drv = {
static int __init serio_raw_init(void)
{
serio_register_driver(&serio_raw_drv);
return 0;
return serio_register_driver(&serio_raw_drv);
}
static void __exit serio_raw_exit(void)

View file

@ -397,8 +397,7 @@ static struct serio_driver elo_drv = {
static int __init elo_init(void)
{
serio_register_driver(&elo_drv);
return 0;
return serio_register_driver(&elo_drv);
}
static void __exit elo_exit(void)

View file

@ -194,8 +194,7 @@ static struct serio_driver gunze_drv = {
static int __init gunze_init(void)
{
serio_register_driver(&gunze_drv);
return 0;
return serio_register_driver(&gunze_drv);
}
static void __exit gunze_exit(void)

View file

@ -478,8 +478,7 @@ static struct serio_driver h3600ts_drv = {
static int __init h3600ts_init(void)
{
serio_register_driver(&h3600ts_drv);
return 0;
return serio_register_driver(&h3600ts_drv);
}
static void __exit h3600ts_exit(void)

View file

@ -208,8 +208,7 @@ static struct serio_driver mtouch_drv = {
static int __init mtouch_init(void)
{
serio_register_driver(&mtouch_drv);
return 0;
return serio_register_driver(&mtouch_drv);
}
static void __exit mtouch_exit(void)

View file

@ -171,8 +171,7 @@ static struct serio_driver pm_drv = {
static int __init pm_init(void)
{
serio_register_driver(&pm_drv);
return 0;
return serio_register_driver(&pm_drv);
}
static void __exit pm_exit(void)

View file

@ -182,8 +182,7 @@ static struct serio_driver tr_drv = {
static int __init tr_init(void)
{
serio_register_driver(&tr_drv);
return 0;
return serio_register_driver(&tr_drv);
}
static void __exit tr_exit(void)

View file

@ -189,8 +189,7 @@ static struct serio_driver tw_drv = {
static int __init tw_init(void)
{
serio_register_driver(&tw_drv);
return 0;
return serio_register_driver(&tw_drv);
}
static void __exit tw_exit(void)