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>
This commit is contained in:
Simon Glass 2024-09-01 16:26:20 -06:00 committed by Tom Rini
parent 010c449263
commit bc624321dc
5 changed files with 97 additions and 0 deletions

View file

@ -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.
*/