Re: [PATCH 4/8] printk: Cleanup _braille_(un)register_console() wrappers
From: Chris Down
Date: Thu Feb 19 2026 - 09:51:50 EST
Petr Mladek writes:
The _braille_(un)register_console() wrappers currently attempt to hide
implementation details like the CON_BRL flag and pc->brl_options. This
forces callers to handle an unconventional tri-state return value (0 for
NOP, >0 for success, <0 for error), which makes the control flow harder
to follow and non-standard.
Refactor the wrappers to use standard kernel return codes (0 for success,
-ERRCODE on failure). Move the responsibility of checking brl_options
to the caller to make the logic more explicit.
Additionally, move the assignment of the CON_BRL flag from the internal
wrapper to braille_register_console(). This aligns it with how
CON_ENABLED is handled. To maintain symmetry and fix a potential bug
where flags might persist after removal, explicitly clear both
CON_ENABLED and CON_BRL in braille_unregister_console().
Signed-off-by: Petr Mladek <pmladek@xxxxxxxx>
Nice, looks good. Thanks!
Acked-by: Chris Down <chris@xxxxxxxxxxxxxx>