Commit c0c9209ddd96bc4f1d70a8b9958710671e076080

Authored by Pascal Terjan
Committed by Linus Torvalds
1 parent 16dbc6c961

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>

Showing 1 changed file with 4 additions and 9 deletions Side-by-side Diff

drivers/accessibility/braille/braille_console.c
... ... @@ -376,6 +376,8 @@
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  
382 384  
... ... @@ -383,16 +385,9 @@
383 385 {
384 386 if (braille_co != console)
385 387 return -EINVAL;
  388 + unregister_keyboard_notifier(&keyboard_notifier_block);
  389 + unregister_vt_notifier(&vt_notifier_block);
386 390 braille_co = NULL;
387 391 return 0;
388 392 }
389   -
390   -static int __init braille_init(void)
391   -{
392   - register_keyboard_notifier(&keyboard_notifier_block);
393   - register_vt_notifier(&vt_notifier_block);
394   - return 0;
395   -}
396   -
397   -console_initcall(braille_init);