X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=common%2Fcmd_console.c;h=178fbfeaa897854a22b1a38d2ec17d9dadeff2b0;hb=922754cc82a82ac90e486b7565a148c9e4b6b584;hp=a5f792b0648895839fde6cbf3596ef1f59d4173e;hpb=3863585bb1c1e8f89b4a2e90c4b83f8b81b8e029;p=u-boot diff --git a/common/cmd_console.c b/common/cmd_console.c index a5f792b064..178fbfeaa8 100644 --- a/common/cmd_console.c +++ b/common/cmd_console.c @@ -26,21 +26,22 @@ */ #include #include -#include - -#if (CONFIG_COMMANDS & CFG_CMD_CONSOLE) +#include extern void _do_coninfo (void); int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[]) { - int i, l; + int l; + struct list_head *list = stdio_get_list(); + struct list_head *pos; + struct stdio_dev *dev; /* Scan for valid output and input devices */ - printf ("List of available devices:\n"); + puts ("List of available devices:\n"); - for (i = 1; i <= ListNumItems (devlist); i++) { - device_t *dev = ListGetPtrToItem (devlist, i); + list_for_each(pos, list) { + dev = list_entry(pos, struct stdio_dev, list); printf ("%-8s %08x %c%c%c ", dev->name, @@ -58,4 +59,12 @@ int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[]) } return 0; } -#endif /* CFG_CMD_CONSOLE */ + + +/***************************************************/ + +U_BOOT_CMD( + coninfo, 3, 1, do_coninfo, + "print console devices and information", + "" +);