]> git.sur5r.net Git - u-boot/blobdiff - common/cmd_terminal.c
fsl-ddr: add the DDR3 SPD infrastructure
[u-boot] / common / cmd_terminal.c
index 88716072b30c623d8fc70064228cc0bb4e69c57f..fd3dd4851480969f968b190d6e00b2e4df304cc4 100644 (file)
 #include <common.h>
 #include <command.h>
 #include <devices.h>
-
-#if defined(CONFIG_CMD_TERMINAL)
+#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;
 
@@ -40,13 +38,7 @@ int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
                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 = device_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 */