/* Execute command if required */
        if (state->cmd) {
+               int retval;
+
                cli_init();
 
-               run_command_list(state->cmd, -1, 0);
+               retval = run_command_list(state->cmd, -1, 0);
                if (!state->interactive)
-                       os_exit(state->exit_type);
+                       os_exit(retval);
        }
 
        return 0;
 
 static struct sandbox_state main_state;
 static struct sandbox_state *state;    /* Pointer to current state record */
 
-void state_record_exit(enum exit_type_id exit_type)
-{
-       state->exit_type = exit_type;
-}
-
 static int state_ensure_space(int extra_size)
 {
        void *blob = state->state_fdt;
 
 #include <stdbool.h>
 #include <linux/stringify.h>
 
-/* How we exited U-Boot */
-enum exit_type_id {
-       STATE_EXIT_NORMAL,
-       STATE_EXIT_COLD_REBOOT,
-       STATE_EXIT_POWER_OFF,
-};
-
 /**
  * Selects the behavior of the serial terminal.
  *
        const char *cmd;                /* Command to execute */
        bool interactive;               /* Enable cmdline after execute */
        const char *fdt_fname;          /* Filename of FDT binary */
-       enum exit_type_id exit_type;    /* How we exited U-Boot */
        const char *parse_err;          /* Error to report from parsing */
        int argc;                       /* Program arguments */
        char **argv;                    /* Command line arguments */
                .compat = _compat, \
        }
 
-/**
- * Record the exit type to be reported by the test program.
- *
- * @param exit_type    Exit type to record
- */
-void state_record_exit(enum exit_type_id exit_type);
-
 /**
  * Gets a pointer to the current state.
  *