summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-05-10 23:16:53 +0300
committerTom Rini <trini@konsulko.com>2020-06-25 20:24:12 +0300
commit441539f90a21156c69e870fcbda13157ce69a1dc (patch)
tree27b9333efb35e01b32caec8d0491dfac9a6e9311 /cmd
parent3c89c4c8562754fe1540938ec0ddbb41e7d130a8 (diff)
downloadu-boot-441539f90a21156c69e870fcbda13157ce69a1dc.tar.xz
bdinfo: net: Drop legacy ethernet bdinfo
This code pre-dates driver model and the migration date is nearly upon us. Pare the print_eths() function down and enable it for driver model, since it works correctly. The IP address is already printed in print_eth_ip_addr() so we can remove that. Since this results in a one-line print_eths() function, inline it. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/bdinfo.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index 1a08e14d08..f1d6a013f5 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -36,27 +36,6 @@ static void print_eth(int idx)
printf("%-12s= %s\n", name, val);
}
-#ifndef CONFIG_DM_ETH
-__maybe_unused
-static void print_eths(void)
-{
- struct eth_device *dev;
- int i = 0;
-
- do {
- dev = eth_get_dev_by_index(i);
- if (dev) {
- printf("eth%dname = %s\n", i, dev->name);
- print_eth(i);
- i++;
- }
- } while (dev);
-
- printf("current eth = %s\n", eth_get_name());
- printf("ip_addr = %s\n", env_get("ipaddr"));
-}
-#endif
-
static void print_lnum(const char *name, unsigned long long value)
{
printf("%-12s= 0x%.8llX\n", name, value);
@@ -118,9 +97,8 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
print_num("relocaddr", gd->relocaddr);
print_num("reloc off", gd->reloc_off);
printf("%-12s= %u-bit\n", "Build", (uint)sizeof(void *) * 8);
-#if defined(CONFIG_CMD_NET) && !defined(CONFIG_DM_ETH)
- print_eths();
-#endif
+ if (IS_ENABLED(CONFIG_CMD_NET))
+ printf("current eth = %s\n", eth_get_name());
print_num("fdt_blob", (ulong)gd->fdt_blob);
print_num("new_fdt", (ulong)gd->new_fdt);
print_num("fdt_size", (ulong)gd->fdt_size);