terminal: only serial_reinit_all if available
authorAsherah Connor <ashe@kivikakk.ee>
Wed, 10 Mar 2021 11:39:24 +0000 (22:39 +1100)
committerTom Rini <trini@konsulko.com>
Mon, 12 Apr 2021 21:44:55 +0000 (17:44 -0400)
serial_reinit_all() is only available if CONFIG_SERIAL is defined (i.e.
!CONFIG_DM_SERIAL).

Signed-off-by: Asherah Connor <ashe@kivikakk.ee>
Reviewed-by: Simon Glass <sjg@chromium.org>
cmd/terminal.c

index 733701e05961d39e299fce1c1a5a2b4f57d112bf..9e32a4191e1e8cb0762039bbbdf3f09b44f308b5 100644 (file)
@@ -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");