summaryrefslogtreecommitdiff
path: root/api_examples
diff options
context:
space:
mode:
authorRafal Jaworowski <raj@semihalf.com>2009-01-23 13:27:17 +0100
committerWolfgang Denk <wd@denx.de>2009-02-18 00:39:43 +0100
commit44a94e596ba0f6d0951b165403c520bf55b1c56f (patch)
treea889f7774638e79271b2c2ad39f08ba0bf1213f5 /api_examples
parent7fb6c4f9b06c5539043c8bfc6565710b8090841d (diff)
downloadu-boot-imx-44a94e596ba0f6d0951b165403c520bf55b1c56f.zip
u-boot-imx-44a94e596ba0f6d0951b165403c520bf55b1c56f.tar.gz
u-boot-imx-44a94e596ba0f6d0951b165403c520bf55b1c56f.tar.bz2
API: Only output test data when reading was successful.
Signed-off-by: Rafal Czubak <rcz@semihalf.com>
Diffstat (limited to 'api_examples')
-rw-r--r--api_examples/demo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/api_examples/demo.c b/api_examples/demo.c
index 69ac318..2510ed8 100644
--- a/api_examples/demo.c
+++ b/api_examples/demo.c
@@ -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");