aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/accessibility
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/accessibility')
-rw-r--r--drivers/accessibility/braille/braille_console.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/accessibility/braille/braille_console.c b/drivers/accessibility/braille/braille_console.c
index d21167bfc865..dc34a5b8bcee 100644
--- a/drivers/accessibility/braille/braille_console.c
+++ b/drivers/accessibility/braille/braille_console.c
@@ -359,6 +359,9 @@ int braille_register_console(struct console *console, int index,
359 char *console_options, char *braille_options) 359 char *console_options, char *braille_options)
360{ 360{
361 int ret; 361 int ret;
362
363 if (!(console->flags & CON_BRL))
364 return 0;
362 if (!console_options) 365 if (!console_options)
363 /* Only support VisioBraille for now */ 366 /* Only support VisioBraille for now */
364 console_options = "57600o8"; 367 console_options = "57600o8";
@@ -374,15 +377,17 @@ int braille_register_console(struct console *console, int index,
374 braille_co = console; 377 braille_co = console;
375 register_keyboard_notifier(&keyboard_notifier_block); 378 register_keyboard_notifier(&keyboard_notifier_block);
376 register_vt_notifier(&vt_notifier_block); 379 register_vt_notifier(&vt_notifier_block);
377 return 0; 380 return 1;
378} 381}
379 382
380int braille_unregister_console(struct console *console) 383int braille_unregister_console(struct console *console)
381{ 384{
382 if (braille_co != console) 385 if (braille_co != console)
383 return -EINVAL; 386 return -EINVAL;
387 if (!(console->flags & CON_BRL))
388 return 0;
384 unregister_keyboard_notifier(&keyboard_notifier_block); 389 unregister_keyboard_notifier(&keyboard_notifier_block);
385 unregister_vt_notifier(&vt_notifier_block); 390 unregister_vt_notifier(&vt_notifier_block);
386 braille_co = NULL; 391 braille_co = NULL;
387 return 0; 392 return 1;
388} 393}