]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/cmd_terminal.c
add redundant environment for env_sf.c
[people/ms/u-boot.git] / common / cmd_terminal.c
index 88716072b30c623d8fc70064228cc0bb4e69c57f..60ec378b3c93a40eea63025d9af2506dd09d3df9 100644 (file)
  */
 #include <common.h>
 #include <command.h>
-#include <devices.h>
-
-#if defined(CONFIG_CMD_TERMINAL)
+#include <stdio_dev.h>
+#include <serial.h>
 
 int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
-       int i, l;
        int last_tilde = 0;
-       device_t *dev = NULL;
+       struct stdio_dev *dev = NULL;
 
        if (argc < 1)
                return -1;
 
        /* Scan for selected output/input device */
-       for (i = 1; i <= ListNumItems (devlist); i++) {
-               device_t *tmp = ListGetPtrToItem (devlist, i);
-               if (!strcmp(tmp->name, argv[1])) {
-                       dev = tmp;
-                       break;
-               }
-       }
+       dev = stdio_get_by_name(argv[1]);
        if (!dev)
                return -1;
 
@@ -95,8 +87,6 @@ int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 
 U_BOOT_CMD(
        terminal,       3,      1,      do_terminal,
-       "terminal - start terminal emulator\n",
+       "start terminal emulator",
        ""
 );
-
-#endif /* CONFIG_CMD_TERMINAL */