From 5c935eb6f7075b227178ddd3a3a231bef4b7238d Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Wed, 10 Mar 2021 22:39:23 +1100 Subject: terminal: correct stdio_dev invocations stdio_dev methods have taken a pointer to themselves since 709ea543 (nearly 7 years ago). Signed-off-by: Asherah Connor Reviewed-by: Simon Glass --- cmd/terminal.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cmd/terminal.c') diff --git a/cmd/terminal.c b/cmd/terminal.c index f6e4d2539e3..733701e0596 100644 --- a/cmd/terminal.c +++ b/cmd/terminal.c @@ -33,8 +33,8 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[]) int c; /* read from console and display on serial port */ - if (stdio_devices[0]->tstc()) { - c = stdio_devices[0]->getc(); + if (stdio_devices[0]->tstc(stdio_devices[0])) { + c = stdio_devices[0]->getc(stdio_devices[0]); if (last_tilde == 1) { if (c == '.') { putc(c); @@ -43,7 +43,7 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[]) } else { last_tilde = 0; /* write the delayed tilde */ - dev->putc('~'); + dev->putc(dev, '~'); /* fall-through to print current * character */ } @@ -53,12 +53,12 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[]) puts("[u-boot]"); putc(c); } - dev->putc(c); + dev->putc(dev, c); } /* read from serial port and display on console */ - if (dev->tstc()) { - c = dev->getc(); + if (dev->tstc(dev)) { + c = dev->getc(dev); putc(c); } } -- cgit v1.2.3 From ac3821430e0e2dc6ddb766950b0098c67d4969d3 Mon Sep 17 00:00:00 2001 From: Asherah Connor Date: Wed, 10 Mar 2021 22:39:24 +1100 Subject: terminal: only serial_reinit_all if available serial_reinit_all() is only available if CONFIG_SERIAL is defined (i.e. !CONFIG_DM_SERIAL). Signed-off-by: Asherah Connor Reviewed-by: Simon Glass --- cmd/terminal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmd/terminal.c') diff --git a/cmd/terminal.c b/cmd/terminal.c index 733701e0596..9e32a4191e1 100644 --- a/cmd/terminal.c +++ b/cmd/terminal.c @@ -25,7 +25,9 @@ int do_terminal(struct cmd_tbl *cmd, int flag, int argc, char *const argv[]) if (!dev) return -1; - serial_reinit_all(); + if (IS_ENABLED(CONFIG_SERIAL)) + serial_reinit_all(); + printf("Entering terminal mode for port %s\n", dev->name); puts("Use '~.' to leave the terminal and get back to u-boot\n"); -- cgit v1.2.3