diff mbox series

[2/9] dm: core: Sort dm subcommands

Message ID 20220508103927.912854-3-sjg@chromium.org
State Accepted
Delegated to: Simon Glass
Headers show
Series dm: core: Support collecting and reporting stats | expand

Commit Message

Simon Glass May 8, 2022, 10:39 a.m. UTC
Put these in alphabetic order, both in the help and in the implementation,
as there are quite a few subcommands now. Tweak the help for 'dm tree' to
better explain what it does.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 cmd/dm.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

Comments

Simon Glass June 28, 2022, 1:38 p.m. UTC | #1
Put these in alphabetic order, both in the help and in the implementation,
as there are quite a few subcommands now. Tweak the help for 'dm tree' to
better explain what it does.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 cmd/dm.c | 48 ++++++++++++++++++++++++------------------------
 1 file changed, 24 insertions(+), 24 deletions(-)

Applied to u-boot-dm, thanks!
diff mbox series

Patch

diff --git a/cmd/dm.c b/cmd/dm.c
index cb4c358e942..4c0a8a53ced 100644
--- a/cmd/dm.c
+++ b/cmd/dm.c
@@ -16,18 +16,10 @@ 
 #include <dm/root.h>
 #include <dm/util.h>
 
-static int do_dm_dump_tree(struct cmd_tbl *cmdtp, int flag, int argc,
-			   char *const argv[])
-{
-	dm_dump_tree();
-
-	return 0;
-}
-
-static int do_dm_dump_uclass(struct cmd_tbl *cmdtp, int flag, int argc,
-			     char *const argv[])
+static int do_dm_dump_driver_compat(struct cmd_tbl *cmdtp, int flag, int argc,
+				    char * const argv[])
 {
-	dm_dump_uclass();
+	dm_dump_driver_compat();
 
 	return 0;
 }
@@ -48,29 +40,37 @@  static int do_dm_dump_drivers(struct cmd_tbl *cmdtp, int flag, int argc,
 	return 0;
 }
 
-static int do_dm_dump_driver_compat(struct cmd_tbl *cmdtp, int flag, int argc,
-				    char * const argv[])
+static int do_dm_dump_static_driver_info(struct cmd_tbl *cmdtp, int flag,
+					 int argc, char * const argv[])
 {
-	dm_dump_driver_compat();
+	dm_dump_static_driver_info();
 
 	return 0;
 }
 
-static int do_dm_dump_static_driver_info(struct cmd_tbl *cmdtp, int flag, int argc,
-					 char * const argv[])
+static int do_dm_dump_tree(struct cmd_tbl *cmdtp, int flag, int argc,
+			   char *const argv[])
 {
-	dm_dump_static_driver_info();
+	dm_dump_tree();
+
+	return 0;
+}
+
+static int do_dm_dump_uclass(struct cmd_tbl *cmdtp, int flag, int argc,
+			     char *const argv[])
+{
+	dm_dump_uclass();
 
 	return 0;
 }
 
 static struct cmd_tbl test_commands[] = {
-	U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_tree, "", ""),
-	U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
+	U_BOOT_CMD_MKENT(compat, 1, 1, do_dm_dump_driver_compat, "", ""),
 	U_BOOT_CMD_MKENT(devres, 1, 1, do_dm_dump_devres, "", ""),
 	U_BOOT_CMD_MKENT(drivers, 1, 1, do_dm_dump_drivers, "", ""),
-	U_BOOT_CMD_MKENT(compat, 1, 1, do_dm_dump_driver_compat, "", ""),
 	U_BOOT_CMD_MKENT(static, 1, 1, do_dm_dump_static_driver_info, "", ""),
+	U_BOOT_CMD_MKENT(tree, 0, 1, do_dm_dump_tree, "", ""),
+	U_BOOT_CMD_MKENT(uclass, 1, 1, do_dm_dump_uclass, "", ""),
 };
 
 static __maybe_unused void dm_reloc(void)
@@ -109,10 +109,10 @@  static int do_dm(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 U_BOOT_CMD(
 	dm,	3,	1,	do_dm,
 	"Driver model low level access",
-	"tree          Dump driver model tree ('*' = activated)\n"
-	"dm uclass        Dump list of instances for each uclass\n"
+	"compat        Dump list of drivers with compatibility strings\n"
 	"dm devres        Dump list of device resources for each device\n"
 	"dm drivers       Dump list of drivers with uclass and instances\n"
-	"dm compat        Dump list of drivers with compatibility strings\n"
-	"dm static        Dump list of drivers with static platform data"
+	"dm static        Dump list of drivers with static platform data\n"
+	"dm tree          Dump tree of driver model devices ('*' = activated)\n"
+	"dm uclass        Dump list of instances for each uclass"
 );