return CMD_RET_SUCCESS;
}
-static int do_extension_scan(struct cmd_tbl *cmdtp, int flag,
- int argc, char *const argv[])
+static int extension_scan(bool show)
{
struct extension *extension, *next;
int extension_num;
free(extension);
}
extension_num = extension_board_scan(&extension_list);
+ if (show && extension_num >= 0)
+ printf("Found %d extension board(s).\n", extension_num);
+
+ /* either the number of extensions, or -ve for error */
+ return extension_num;
+}
+
+static int do_extension_scan(struct cmd_tbl *cmdtp, int flag,
+ int argc, char *const argv[])
+{
+ int extension_num;
+
+ extension_num = extension_scan(true);
if (extension_num < 0)
return CMD_RET_FAILURE;
- printf("Found %d extension board(s).\n", extension_num);
-
return CMD_RET_SUCCESS;
}