[U-Boot] [PATCH 21/21] Remove legacy do_reset() function

Kyle Moffett Kyle.D.Moffett at boeing.com
Mon Mar 7 18:37:42 CET 2011


All of the users of the legacy do_reset() function have been converted
to __arch_restart() or __board_restart() as appropriate, so the
compatibility calls to do_reset() may be removed.

In addition the do_generic_reset() function is renamed to the now-unused
name do_reset().

Signed-off-by: Kyle Moffett <Kyle.D.Moffett at boeing.com>
---
 common/cmd_boot.c |   27 +++------------------------
 include/command.h |    1 -
 2 files changed, 3 insertions(+), 25 deletions(-)

diff --git a/common/cmd_boot.c b/common/cmd_boot.c
index c0f26fc..422d20c 100644
--- a/common/cmd_boot.c
+++ b/common/cmd_boot.c
@@ -72,9 +72,6 @@ void emergency_restart(void)
 	__board_emergency_restart();
 	__arch_emergency_restart();
 
-	/* Fallback to the old do_reset() until everything is converted. */
-	do_reset(NULL, 0, 0, NULL);
-
 	printf("EMERGENCY RESTART: All attempts to reboot failed!");
 	hang();
 }
@@ -129,11 +126,6 @@ int system_restart(void)
 
 	/* Now call into the architecture-specific code */
 	err = __arch_restart();
-	if (err)
-		goto failed;
-
-	/* Fallback to the old do_reset() until everything is converted. */
-	err = do_reset(NULL, 0, 0, NULL);
 
 failed:
 	printf("*** SYSTEM RESTART FAILED ***\n");
@@ -157,7 +149,7 @@ int __board_restart(void)
 __attribute__((__weak__))
 int __arch_restart(void)
 {
-	/* Fallthrough to legacy do_reset() code */
+	/* Some architectures have no generic reboot capability */
 	return 0;
 }
 
@@ -166,24 +158,11 @@ int __arch_restart(void)
  *
  * This is what you get when you type "reset" at the command line.
  */
-int do_generic_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
 	return system_restart();
 }
 
-/*
- * Empty legacy "do_reset" stub.
- *
- * This allows a platform using the new __board_restart() and
- * __arch_restart() hooks to completely omit the old do_reset() function.
- */
-int do_reset_stub(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
-{
-	return 0;
-}
-__attribute__((__weak__,__alias__("do_reset_stub")))
-int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
-
 /* -------------------------------------------------------------------- */
 
 U_BOOT_CMD(
@@ -194,7 +173,7 @@ U_BOOT_CMD(
 );
 
 U_BOOT_CMD(
-	reset, 1, 0,	do_generic_reset,
+	reset, 1, 0,	do_reset,
 	"Perform RESET of the CPU",
 	""
 );
diff --git a/include/command.h b/include/command.h
index ad8c915..d87f45d 100644
--- a/include/command.h
+++ b/include/command.h
@@ -99,7 +99,6 @@ extern int cmd_get_data_size(char* arg, int default_size);
 extern int do_bootd(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 #endif
 extern int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
-extern int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]);
 
 /* Generic system restart functions */
 __attribute__((__noreturn__))
-- 
1.7.2.3



More information about the U-Boot mailing list