]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
API: Only output test data when reading was successful.
authorRafal Jaworowski <raj@semihalf.com>
Fri, 23 Jan 2009 12:27:17 +0000 (13:27 +0100)
committerWolfgang Denk <wd@denx.de>
Tue, 17 Feb 2009 23:39:43 +0000 (00:39 +0100)
Signed-off-by: Rafal Czubak <rcz@semihalf.com>
api_examples/demo.c

index 69ac318375a7c2afc6b94eed97f140c05ccce66c..2510ed8866d77c09816cb1351604e4c41dfa04a2 100644 (file)
@@ -135,9 +135,10 @@ int main(int argc, char *argv[])
 
                else if ((rv = ub_dev_read(i, buf, 1, 0)) != 0)
                        errf("could not read from device %d, error %d\n", i, rv);
-
-               printf("Sector 0 dump (512B):\n");
-               test_dump_buf(buf, 512);
+               else {
+                       printf("Sector 0 dump (512B):\n");
+                       test_dump_buf(buf, 512);
+               }
 
                ub_dev_close(i);
        }
@@ -178,6 +179,7 @@ int main(int argc, char *argv[])
                printf("%s = %s\n", env, ub_env_get(env));
 
        /* reset */
+       printf("\n*** Resetting board ***\n");
        ub_reset();
        printf("\nHmm, reset returned...?!\n");