bdinfo: xtensa: Create a generic do_bdinfo for xtensa
authorSimon Glass <sjg@chromium.org>
Sun, 10 May 2020 20:16:28 +0000 (14:16 -0600)
committerTom Rini <trini@konsulko.com>
Thu, 25 Jun 2020 17:24:10 +0000 (13:24 -0400)
This arch uses only the generic function. It would be nice if all the
archs did the same. As a first step, create a new generic function for the
'bd' command and make xtensa use it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
cmd/bdinfo.c

index dba552b..83fea50 100644 (file)
@@ -476,14 +476,20 @@ int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 
 #elif defined(CONFIG_XTENSA)
 
+#define USE_GENERIC
+
+#else
+ #error "a case for this architecture does not exist!"
+#endif
+
+/* Temporary check for archs that use generic bdinfo. Eventually all will */
+#ifdef USE_GENERIC
 int do_bdinfo(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 {
        print_std_bdinfo(gd->bd);
+
        return 0;
 }
-
-#else
- #error "a case for this architecture does not exist!"
 #endif
 
 /* -------------------------------------------------------------------- */