diff options
author | Simon Glass <sjg@chromium.org> | 2024-09-01 16:26:20 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-09-18 13:01:00 -0600 |
commit | bc624321dc358b2d0fb1436533ece68e6422764c (patch) | |
tree | b59d1ebbefeb9c343f6b407f72a789f944226106 /include/console.h | |
parent | 010c44926386254ce7a6ec20bc75ffd5196be85c (diff) |
dm: usb: Deal with USB keyboard persisting across tests
Clear any USB-keyboard devices before running a unit test, to avoid
using a stale udevice pointer in stdio. Add a long comment to explain
this situation and why this solution seems best, at least for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/console.h')
-rw-r--r-- | include/console.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/console.h b/include/console.h index 6b6d0f9de73..57fdb0834c1 100644 --- a/include/console.h +++ b/include/console.h @@ -179,6 +179,14 @@ void console_puts_select_stderr(bool serial_only, const char *s); */ int console_clear(void); +/** + * console_remove_by_name() - Remove a console by its stdio name + * + * This must only be used in tests. It removes any use of the named stdio device + * from the console tables. + */ +int console_remove_by_name(const char *name); + /* * CONSOLE multiplexing. */ |