]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
ac14xx: re-order the recovery condition checks
authorGerhard Sittig <gsi@denx.de>
Wed, 5 Jun 2013 12:51:08 +0000 (14:51 +0200)
committerWolfgang Denk <wd@denx.de>
Mon, 24 Jun 2013 20:26:57 +0000 (22:26 +0200)
re-order the conditions which make the recovery system startup: combine
those conditions which were explicitly initiated (key press, software
request) and those which post-process error conditions (installer issues)

Signed-off-by: Gerhard Sittig <gsi@denx.de>
board/ifm/ac14xx/ac14xx.c

index c8e88cc99eb3b1067a67072bdd9c108d1f4ef735..dc2aff099301e8ca0e95846ae3053c3b0b2c71bd 100644 (file)
@@ -336,8 +336,8 @@ int misc_init_r(void)
        /*
         * enforce the start of the recovery system when
         * - the appropriate keys were pressed
-        * - a previous installation was aborted or has failed
         * - "some" external software told us to
+        * - a previous installation was aborted or has failed
         */
        want_recovery = 0;
        keys = gpio_querykbd();
@@ -347,6 +347,11 @@ int misc_init_r(void)
                printf("detected recovery request (keyboard)\n");
                want_recovery = 1;
        }
+       s = getenv("want_recovery");
+       if ((s != NULL) && (*s != '\0')) {
+               printf("detected recovery request (environment)\n");
+               want_recovery = 1;
+       }
        s = getenv("install_in_progress");
        if ((s != NULL) && (*s != '\0')) {
                printf("previous installation has not completed\n");
@@ -357,11 +362,6 @@ int misc_init_r(void)
                printf("previous installation has failed\n");
                want_recovery = 1;
        }
-       s = getenv("want_recovery");
-       if ((s != NULL) && (*s != '\0')) {
-               printf("detected recovery request (environment)\n");
-               want_recovery = 1;
-       }
        if (want_recovery) {
                printf("enforced start of the recovery system\n");
                setenv("bootcmd", "run recovery");