braille_console: only register notifiers when the braille console is used

Only register the braille driver VT and keyboard notifiers when the
braille console is used. Avoids eating insert or backspace keys.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=11242

Signed-off-by: Pascal Terjan <pterjan@mandriva.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Pascal Terjan and committed by Linus Torvalds c0c9209d 16dbc6c9

+4 -9
+4 -9
drivers/accessibility/braille/braille_console.c
··· 376 376 console->flags |= CON_ENABLED; 377 377 console->index = index; 378 378 braille_co = console; 379 + register_keyboard_notifier(&keyboard_notifier_block); 380 + register_vt_notifier(&vt_notifier_block); 379 381 return 0; 380 382 } 381 383 ··· 385 383 { 386 384 if (braille_co != console) 387 385 return -EINVAL; 386 + unregister_keyboard_notifier(&keyboard_notifier_block); 387 + unregister_vt_notifier(&vt_notifier_block); 388 388 braille_co = NULL; 389 389 return 0; 390 390 } 391 - 392 - static int __init braille_init(void) 393 - { 394 - register_keyboard_notifier(&keyboard_notifier_block); 395 - register_vt_notifier(&vt_notifier_block); 396 - return 0; 397 - } 398 - 399 - console_initcall(braille_init);