[PATCH v2 3/9] cmd: bdinfo: Implement support for printing ethernet settings via bdinfo -e

Marek Vasut marek.vasut+renesas at mailbox.org
Sat Oct 7 23:41:00 CEST 2023


Add support for printing ethernet settings only via 'bdinfo -e' .

Reviewed-by: Simon Glass <sjg at chromium.org>
Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>
---
Cc: Bin Meng <bmeng.cn at gmail.com>
Cc: Mario Six <mario.six at gdsys.cc>
Cc: Nikhil M Jain <n-jain1 at ti.com>
Cc: Simon Glass <sjg at chromium.org>
---
V2: Add RB from Simon
---
 cmd/bdinfo.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/cmd/bdinfo.c b/cmd/bdinfo.c
index c720ee6f9b6..79106caeec2 100644
--- a/cmd/bdinfo.c
+++ b/cmd/bdinfo.c
@@ -193,10 +193,15 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 		return bdinfo_print_all(bd);
 
 	getopt_init_state(&gs);
-	while ((opt = getopt(&gs, argc, argv, "am")) > 0) {
+	while ((opt = getopt(&gs, argc, argv, "aem")) > 0) {
 		switch (opt) {
 		case 'a':
 			return bdinfo_print_all(bd);
+		case 'e':
+			if (!IS_ENABLED(CONFIG_CMD_NET))
+				return CMD_RET_USAGE;
+			print_eth();
+			return CMD_RET_SUCCESS;
 		case 'm':
 			print_bi_dram(bd);
 			return CMD_RET_SUCCESS;
-- 
2.40.1



More information about the U-Boot mailing list