diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2006-11-23 23:35:10 -0500 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2006-11-23 23:35:10 -0500 |
commit | 153a9df01c0d1ecdc56161c7a0f830325145dd64 (patch) | |
tree | 6645b72a6036bb2491d1e54317009259e41bf568 /drivers | |
parent | ed7b1f6d6ea1054ea4fe293a7fd8015fc3803d93 (diff) |
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')
26 files changed, 41 insertions, 53 deletions
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index 706e0aea793c..3393a37fec39 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c | |||
@@ -467,13 +467,21 @@ int iforce_init_device(struct iforce *iforce) | |||
467 | 467 | ||
468 | static int __init iforce_init(void) | 468 | static int __init iforce_init(void) |
469 | { | 469 | { |
470 | int err = 0; | ||
471 | |||
470 | #ifdef CONFIG_JOYSTICK_IFORCE_USB | 472 | #ifdef CONFIG_JOYSTICK_IFORCE_USB |
471 | usb_register(&iforce_usb_driver); | 473 | err = usb_register(&iforce_usb_driver); |
474 | if (err) | ||
475 | return err; | ||
472 | #endif | 476 | #endif |
473 | #ifdef CONFIG_JOYSTICK_IFORCE_232 | 477 | #ifdef CONFIG_JOYSTICK_IFORCE_232 |
474 | serio_register_driver(&iforce_serio_drv); | 478 | err = serio_register_driver(&iforce_serio_drv); |
479 | #ifdef CONFIG_JOYSTICK_IFORCE_USB | ||
480 | if (err) | ||
481 | usb_deregister(&iforce_usb_driver); | ||
475 | #endif | 482 | #endif |
476 | return 0; | 483 | #endif |
484 | return err; | ||
477 | } | 485 | } |
478 | 486 | ||
479 | static void __exit iforce_exit(void) | 487 | static void __exit iforce_exit(void) |
diff --git a/drivers/input/joystick/magellan.c b/drivers/input/joystick/magellan.c index d512b0a0282e..4112789f1196 100644 --- a/drivers/input/joystick/magellan.c +++ b/drivers/input/joystick/magellan.c | |||
@@ -231,8 +231,7 @@ static struct serio_driver magellan_drv = { | |||
231 | 231 | ||
232 | static int __init magellan_init(void) | 232 | static int __init magellan_init(void) |
233 | { | 233 | { |
234 | serio_register_driver(&magellan_drv); | 234 | return serio_register_driver(&magellan_drv); |
235 | return 0; | ||
236 | } | 235 | } |
237 | 236 | ||
238 | static void __exit magellan_exit(void) | 237 | static void __exit magellan_exit(void) |
diff --git a/drivers/input/joystick/spaceball.c b/drivers/input/joystick/spaceball.c index 9b3597343c1c..08bf113e62eb 100644 --- a/drivers/input/joystick/spaceball.c +++ b/drivers/input/joystick/spaceball.c | |||
@@ -300,8 +300,7 @@ static struct serio_driver spaceball_drv = { | |||
300 | 300 | ||
301 | static int __init spaceball_init(void) | 301 | static int __init spaceball_init(void) |
302 | { | 302 | { |
303 | serio_register_driver(&spaceball_drv); | 303 | return serio_register_driver(&spaceball_drv); |
304 | return 0; | ||
305 | } | 304 | } |
306 | 305 | ||
307 | static void __exit spaceball_exit(void) | 306 | static void __exit spaceball_exit(void) |
diff --git a/drivers/input/joystick/spaceorb.c b/drivers/input/joystick/spaceorb.c index ea9d51e70a12..c9c79211af71 100644 --- a/drivers/input/joystick/spaceorb.c +++ b/drivers/input/joystick/spaceorb.c | |||
@@ -246,8 +246,7 @@ static struct serio_driver spaceorb_drv = { | |||
246 | 246 | ||
247 | static int __init spaceorb_init(void) | 247 | static int __init spaceorb_init(void) |
248 | { | 248 | { |
249 | serio_register_driver(&spaceorb_drv); | 249 | return serio_register_driver(&spaceorb_drv); |
250 | return 0; | ||
251 | } | 250 | } |
252 | 251 | ||
253 | static void __exit spaceorb_exit(void) | 252 | static void __exit spaceorb_exit(void) |
diff --git a/drivers/input/joystick/stinger.c b/drivers/input/joystick/stinger.c index b51a4a4c7f60..ecb0916215fa 100644 --- a/drivers/input/joystick/stinger.c +++ b/drivers/input/joystick/stinger.c | |||
@@ -216,8 +216,7 @@ static struct serio_driver stinger_drv = { | |||
216 | 216 | ||
217 | static int __init stinger_init(void) | 217 | static int __init stinger_init(void) |
218 | { | 218 | { |
219 | serio_register_driver(&stinger_drv); | 219 | return serio_register_driver(&stinger_drv); |
220 | return 0; | ||
221 | } | 220 | } |
222 | 221 | ||
223 | static void __exit stinger_exit(void) | 222 | static void __exit stinger_exit(void) |
diff --git a/drivers/input/joystick/twidjoy.c b/drivers/input/joystick/twidjoy.c index 3c1c83e8609a..9cf17d6ced82 100644 --- a/drivers/input/joystick/twidjoy.c +++ b/drivers/input/joystick/twidjoy.c | |||
@@ -269,8 +269,7 @@ static struct serio_driver twidjoy_drv = { | |||
269 | 269 | ||
270 | static int __init twidjoy_init(void) | 270 | static int __init twidjoy_init(void) |
271 | { | 271 | { |
272 | serio_register_driver(&twidjoy_drv); | 272 | return serio_register_driver(&twidjoy_drv); |
273 | return 0; | ||
274 | } | 273 | } |
275 | 274 | ||
276 | static void __exit twidjoy_exit(void) | 275 | static void __exit twidjoy_exit(void) |
diff --git a/drivers/input/joystick/warrior.c b/drivers/input/joystick/warrior.c index 1e4828b9a1ab..29d339acf430 100644 --- a/drivers/input/joystick/warrior.c +++ b/drivers/input/joystick/warrior.c | |||
@@ -224,8 +224,7 @@ static struct serio_driver warrior_drv = { | |||
224 | 224 | ||
225 | static int __init warrior_init(void) | 225 | static int __init warrior_init(void) |
226 | { | 226 | { |
227 | serio_register_driver(&warrior_drv); | 227 | return serio_register_driver(&warrior_drv); |
228 | return 0; | ||
229 | } | 228 | } |
230 | 229 | ||
231 | static void __exit warrior_exit(void) | 230 | static void __exit warrior_exit(void) |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 73c6946b2d92..498e64a00e3c 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -1389,8 +1389,7 @@ static ssize_t atkbd_show_err_count(struct atkbd *atkbd, char *buf) | |||
1389 | 1389 | ||
1390 | static int __init atkbd_init(void) | 1390 | static int __init atkbd_init(void) |
1391 | { | 1391 | { |
1392 | serio_register_driver(&atkbd_drv); | 1392 | return serio_register_driver(&atkbd_drv); |
1393 | return 0; | ||
1394 | } | 1393 | } |
1395 | 1394 | ||
1396 | static void __exit atkbd_exit(void) | 1395 | static void __exit atkbd_exit(void) |
diff --git a/drivers/input/keyboard/hil_kbd.c b/drivers/input/keyboard/hil_kbd.c index e774dd31e99b..7cc9728b04df 100644 --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c | |||
@@ -381,8 +381,7 @@ struct serio_driver hil_kbd_serio_drv = { | |||
381 | 381 | ||
382 | static int __init hil_kbd_init(void) | 382 | static int __init hil_kbd_init(void) |
383 | { | 383 | { |
384 | serio_register_driver(&hil_kbd_serio_drv); | 384 | return serio_register_driver(&hil_kbd_serio_drv); |
385 | return 0; | ||
386 | } | 385 | } |
387 | 386 | ||
388 | static void __exit hil_kbd_exit(void) | 387 | static void __exit hil_kbd_exit(void) |
diff --git a/drivers/input/keyboard/lkkbd.c b/drivers/input/keyboard/lkkbd.c index 0067c1fe3d4e..1789785813ee 100644 --- a/drivers/input/keyboard/lkkbd.c +++ b/drivers/input/keyboard/lkkbd.c | |||
@@ -758,8 +758,7 @@ static struct serio_driver lkkbd_drv = { | |||
758 | static int __init | 758 | static int __init |
759 | lkkbd_init (void) | 759 | lkkbd_init (void) |
760 | { | 760 | { |
761 | serio_register_driver(&lkkbd_drv); | 761 | return serio_register_driver(&lkkbd_drv); |
762 | return 0; | ||
763 | } | 762 | } |
764 | 763 | ||
765 | static void __exit | 764 | static void __exit |
diff --git a/drivers/input/keyboard/newtonkbd.c b/drivers/input/keyboard/newtonkbd.c index 33e813948d6f..aa29b50765c9 100644 --- a/drivers/input/keyboard/newtonkbd.c +++ b/drivers/input/keyboard/newtonkbd.c | |||
@@ -169,8 +169,7 @@ static struct serio_driver nkbd_drv = { | |||
169 | 169 | ||
170 | static int __init nkbd_init(void) | 170 | static int __init nkbd_init(void) |
171 | { | 171 | { |
172 | serio_register_driver(&nkbd_drv); | 172 | return serio_register_driver(&nkbd_drv); |
173 | return 0; | ||
174 | } | 173 | } |
175 | 174 | ||
176 | static void __exit nkbd_exit(void) | 175 | static void __exit nkbd_exit(void) |
diff --git a/drivers/input/keyboard/stowaway.c b/drivers/input/keyboard/stowaway.c index e60937d17b1c..f7b5c5b81451 100644 --- a/drivers/input/keyboard/stowaway.c +++ b/drivers/input/keyboard/stowaway.c | |||
@@ -173,8 +173,7 @@ static struct serio_driver skbd_drv = { | |||
173 | 173 | ||
174 | static int __init skbd_init(void) | 174 | static int __init skbd_init(void) |
175 | { | 175 | { |
176 | serio_register_driver(&skbd_drv); | 176 | return serio_register_driver(&skbd_drv); |
177 | return 0; | ||
178 | } | 177 | } |
179 | 178 | ||
180 | static void __exit skbd_exit(void) | 179 | static void __exit skbd_exit(void) |
diff --git a/drivers/input/keyboard/sunkbd.c b/drivers/input/keyboard/sunkbd.c index d1b62f77a716..d6ab6d4b1fa8 100644 --- a/drivers/input/keyboard/sunkbd.c +++ b/drivers/input/keyboard/sunkbd.c | |||
@@ -352,8 +352,7 @@ static struct serio_driver sunkbd_drv = { | |||
352 | 352 | ||
353 | static int __init sunkbd_init(void) | 353 | static int __init sunkbd_init(void) |
354 | { | 354 | { |
355 | serio_register_driver(&sunkbd_drv); | 355 | return serio_register_driver(&sunkbd_drv); |
356 | return 0; | ||
357 | } | 356 | } |
358 | 357 | ||
359 | static void __exit sunkbd_exit(void) | 358 | static void __exit sunkbd_exit(void) |
diff --git a/drivers/input/keyboard/xtkbd.c b/drivers/input/keyboard/xtkbd.c index b53f71638583..a82093432138 100644 --- a/drivers/input/keyboard/xtkbd.c +++ b/drivers/input/keyboard/xtkbd.c | |||
@@ -174,8 +174,7 @@ static struct serio_driver xtkbd_drv = { | |||
174 | 174 | ||
175 | static int __init xtkbd_init(void) | 175 | static int __init xtkbd_init(void) |
176 | { | 176 | { |
177 | serio_register_driver(&xtkbd_drv); | 177 | return serio_register_driver(&xtkbd_drv); |
178 | return 0; | ||
179 | } | 178 | } |
180 | 179 | ||
181 | static void __exit xtkbd_exit(void) | 180 | static void __exit xtkbd_exit(void) |
diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c index 4f2b503c1ac7..bfb174fe3230 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 = { | |||
417 | 417 | ||
418 | static int __init hil_ptr_init(void) | 418 | static int __init hil_ptr_init(void) |
419 | { | 419 | { |
420 | serio_register_driver(&hil_ptr_serio_driver); | 420 | return serio_register_driver(&hil_ptr_serio_driver); |
421 | return 0; | ||
422 | } | 421 | } |
423 | 422 | ||
424 | static void __exit hil_ptr_exit(void) | 423 | static void __exit hil_ptr_exit(void) |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 58beca99a9c3..e626b1e737fa 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) | |||
1524 | 1524 | ||
1525 | static int __init psmouse_init(void) | 1525 | static int __init psmouse_init(void) |
1526 | { | 1526 | { |
1527 | int err; | ||
1528 | |||
1527 | kpsmoused_wq = create_singlethread_workqueue("kpsmoused"); | 1529 | kpsmoused_wq = create_singlethread_workqueue("kpsmoused"); |
1528 | if (!kpsmoused_wq) { | 1530 | if (!kpsmoused_wq) { |
1529 | printk(KERN_ERR "psmouse: failed to create kpsmoused workqueue\n"); | 1531 | printk(KERN_ERR "psmouse: failed to create kpsmoused workqueue\n"); |
1530 | return -ENOMEM; | 1532 | return -ENOMEM; |
1531 | } | 1533 | } |
1532 | 1534 | ||
1533 | serio_register_driver(&psmouse_drv); | 1535 | err = serio_register_driver(&psmouse_drv); |
1536 | if (err) | ||
1537 | destroy_workqueue(kpsmoused_wq); | ||
1534 | 1538 | ||
1535 | return 0; | 1539 | return err; |
1536 | } | 1540 | } |
1537 | 1541 | ||
1538 | static void __exit psmouse_exit(void) | 1542 | static void __exit psmouse_exit(void) |
diff --git a/drivers/input/mouse/sermouse.c b/drivers/input/mouse/sermouse.c index 10b51e7f01f6..a85d74710b44 100644 --- a/drivers/input/mouse/sermouse.c +++ b/drivers/input/mouse/sermouse.c | |||
@@ -351,8 +351,7 @@ static struct serio_driver sermouse_drv = { | |||
351 | 351 | ||
352 | static int __init sermouse_init(void) | 352 | static int __init sermouse_init(void) |
353 | { | 353 | { |
354 | serio_register_driver(&sermouse_drv); | 354 | return serio_register_driver(&sermouse_drv); |
355 | return 0; | ||
356 | } | 355 | } |
357 | 356 | ||
358 | static void __exit sermouse_exit(void) | 357 | static void __exit sermouse_exit(void) |
diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c index ffd0d6624a8c..c3d64fcc858d 100644 --- a/drivers/input/mouse/vsxxxaa.c +++ b/drivers/input/mouse/vsxxxaa.c | |||
@@ -574,8 +574,7 @@ static struct serio_driver vsxxxaa_drv = { | |||
574 | static int __init | 574 | static int __init |
575 | vsxxxaa_init (void) | 575 | vsxxxaa_init (void) |
576 | { | 576 | { |
577 | serio_register_driver(&vsxxxaa_drv); | 577 | return serio_register_driver(&vsxxxaa_drv); |
578 | return 0; | ||
579 | } | 578 | } |
580 | 579 | ||
581 | static void __exit | 580 | static void __exit |
diff --git a/drivers/input/serio/serio_raw.c b/drivers/input/serio/serio_raw.c index ba2a2035d648..0e343a6cacc9 100644 --- a/drivers/input/serio/serio_raw.c +++ b/drivers/input/serio/serio_raw.c | |||
@@ -389,8 +389,7 @@ static struct serio_driver serio_raw_drv = { | |||
389 | 389 | ||
390 | static int __init serio_raw_init(void) | 390 | static int __init serio_raw_init(void) |
391 | { | 391 | { |
392 | serio_register_driver(&serio_raw_drv); | 392 | return serio_register_driver(&serio_raw_drv); |
393 | return 0; | ||
394 | } | 393 | } |
395 | 394 | ||
396 | static void __exit serio_raw_exit(void) | 395 | static void __exit serio_raw_exit(void) |
diff --git a/drivers/input/touchscreen/elo.c b/drivers/input/touchscreen/elo.c index 913e1b73bb0e..9d61cd133d01 100644 --- a/drivers/input/touchscreen/elo.c +++ b/drivers/input/touchscreen/elo.c | |||
@@ -397,8 +397,7 @@ static struct serio_driver elo_drv = { | |||
397 | 397 | ||
398 | static int __init elo_init(void) | 398 | static int __init elo_init(void) |
399 | { | 399 | { |
400 | serio_register_driver(&elo_drv); | 400 | return serio_register_driver(&elo_drv); |
401 | return 0; | ||
402 | } | 401 | } |
403 | 402 | ||
404 | static void __exit elo_exit(void) | 403 | static void __exit elo_exit(void) |
diff --git a/drivers/input/touchscreen/gunze.c b/drivers/input/touchscreen/gunze.c index 44f397fff715..9157eb148e84 100644 --- a/drivers/input/touchscreen/gunze.c +++ b/drivers/input/touchscreen/gunze.c | |||
@@ -194,8 +194,7 @@ static struct serio_driver gunze_drv = { | |||
194 | 194 | ||
195 | static int __init gunze_init(void) | 195 | static int __init gunze_init(void) |
196 | { | 196 | { |
197 | serio_register_driver(&gunze_drv); | 197 | return serio_register_driver(&gunze_drv); |
198 | return 0; | ||
199 | } | 198 | } |
200 | 199 | ||
201 | static void __exit gunze_exit(void) | 200 | static void __exit gunze_exit(void) |
diff --git a/drivers/input/touchscreen/h3600_ts_input.c b/drivers/input/touchscreen/h3600_ts_input.c index d9e61ee05ea9..c4116d4f64e7 100644 --- a/drivers/input/touchscreen/h3600_ts_input.c +++ b/drivers/input/touchscreen/h3600_ts_input.c | |||
@@ -478,8 +478,7 @@ static struct serio_driver h3600ts_drv = { | |||
478 | 478 | ||
479 | static int __init h3600ts_init(void) | 479 | static int __init h3600ts_init(void) |
480 | { | 480 | { |
481 | serio_register_driver(&h3600ts_drv); | 481 | return serio_register_driver(&h3600ts_drv); |
482 | return 0; | ||
483 | } | 482 | } |
484 | 483 | ||
485 | static void __exit h3600ts_exit(void) | 484 | static void __exit h3600ts_exit(void) |
diff --git a/drivers/input/touchscreen/mtouch.c b/drivers/input/touchscreen/mtouch.c index c66b399774f2..c3c2d735d0ec 100644 --- a/drivers/input/touchscreen/mtouch.c +++ b/drivers/input/touchscreen/mtouch.c | |||
@@ -208,8 +208,7 @@ static struct serio_driver mtouch_drv = { | |||
208 | 208 | ||
209 | static int __init mtouch_init(void) | 209 | static int __init mtouch_init(void) |
210 | { | 210 | { |
211 | serio_register_driver(&mtouch_drv); | 211 | return serio_register_driver(&mtouch_drv); |
212 | return 0; | ||
213 | } | 212 | } |
214 | 213 | ||
215 | static void __exit mtouch_exit(void) | 214 | static void __exit mtouch_exit(void) |
diff --git a/drivers/input/touchscreen/penmount.c b/drivers/input/touchscreen/penmount.c index 6c7d0c2c76cc..bd2767991ae9 100644 --- a/drivers/input/touchscreen/penmount.c +++ b/drivers/input/touchscreen/penmount.c | |||
@@ -171,8 +171,7 @@ static struct serio_driver pm_drv = { | |||
171 | 171 | ||
172 | static int __init pm_init(void) | 172 | static int __init pm_init(void) |
173 | { | 173 | { |
174 | serio_register_driver(&pm_drv); | 174 | return serio_register_driver(&pm_drv); |
175 | return 0; | ||
176 | } | 175 | } |
177 | 176 | ||
178 | static void __exit pm_exit(void) | 177 | static void __exit pm_exit(void) |
diff --git a/drivers/input/touchscreen/touchright.c b/drivers/input/touchscreen/touchright.c index c74f74e57af0..35ba46c6ad2d 100644 --- a/drivers/input/touchscreen/touchright.c +++ b/drivers/input/touchscreen/touchright.c | |||
@@ -182,8 +182,7 @@ static struct serio_driver tr_drv = { | |||
182 | 182 | ||
183 | static int __init tr_init(void) | 183 | static int __init tr_init(void) |
184 | { | 184 | { |
185 | serio_register_driver(&tr_drv); | 185 | return serio_register_driver(&tr_drv); |
186 | return 0; | ||
187 | } | 186 | } |
188 | 187 | ||
189 | static void __exit tr_exit(void) | 188 | static void __exit tr_exit(void) |
diff --git a/drivers/input/touchscreen/touchwin.c b/drivers/input/touchscreen/touchwin.c index 9911820fa2fe..4dc073dacabb 100644 --- a/drivers/input/touchscreen/touchwin.c +++ b/drivers/input/touchscreen/touchwin.c | |||
@@ -189,8 +189,7 @@ static struct serio_driver tw_drv = { | |||
189 | 189 | ||
190 | static int __init tw_init(void) | 190 | static int __init tw_init(void) |
191 | { | 191 | { |
192 | serio_register_driver(&tw_drv); | 192 | return serio_register_driver(&tw_drv); |
193 | return 0; | ||
194 | } | 193 | } |
195 | 194 | ||
196 | static void __exit tw_exit(void) | 195 | static void __exit tw_exit(void) |