aboutsummaryrefslogtreecommitdiff
path: root/common/usb_kbd.c
diff options
context:
space:
mode:
authorKory Maincent <kory.maincent@bootlin.com>2022-06-22 10:59:31 +0200
committerMarek Vasut <marex@denx.de>2022-07-12 21:59:54 +0200
commit98ac7857f9674a98e6ea886b3dccc782efeacadb (patch)
tree033f2eaa93f8e9b8b05b00c990398b7f06e03a62 /common/usb_kbd.c
parent018cdfc3d01618d9ec6547d4602c12d3ae6e7c2c (diff)
downloadu-boot-98ac7857f9674a98e6ea886b3dccc782efeacadb.zip
u-boot-98ac7857f9674a98e6ea886b3dccc782efeacadb.tar.gz
u-boot-98ac7857f9674a98e6ea886b3dccc782efeacadb.tar.bz2
usb: kbd: allow probing even if usbkbd not in stdin
For now the driver does not probe if usbkbd was not present in stdin. This presents two issues, we can not probe the driver before setting stdin and we can not use this driver in other manner than stdin console. This patch fixes this by adding an else statement. It simply probes the driver without console management in the case "usbkbd" is not in stdin. Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Diffstat (limited to 'common/usb_kbd.c')
-rw-r--r--common/usb_kbd.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/common/usb_kbd.c b/common/usb_kbd.c
index 352d86f..d385bea 100644
--- a/common/usb_kbd.c
+++ b/common/usb_kbd.c
@@ -581,21 +581,22 @@ static int probe_usb_keyboard(struct usb_device *dev)
stdinname = env_get("stdin");
#if CONFIG_IS_ENABLED(CONSOLE_MUX)
- error = iomux_doenv(stdin, stdinname);
- if (error)
- return error;
+ if (strstr(stdinname, DEVNAME) != NULL) {
+ error = iomux_doenv(stdin, stdinname);
+ if (error)
+ return error;
+ }
#else
/* Check if this is the standard input device. */
- if (strcmp(stdinname, DEVNAME))
- return 1;
-
- /* Reassign the console */
- if (overwrite_console())
- return 1;
+ if (!strcmp(stdinname, DEVNAME)) {
+ /* Reassign the console */
+ if (overwrite_console())
+ return 1;
- error = console_assign(stdin, DEVNAME);
- if (error)
- return error;
+ error = console_assign(stdin, DEVNAME);
+ if (error)
+ return error;
+ }
#endif
return 0;