summaryrefslogtreecommitdiff
path: root/common/env_nand.c
diff options
context:
space:
mode:
authorScott Wood <scottwood@freescale.com>2010-07-12 18:17:40 -0500
committerScott Wood <scottwood@freescale.com>2010-07-12 18:17:40 -0500
commit53504a278900939e197d8c35164c27ffee861691 (patch)
tree1a74f10e2e65f279668b7db8ea064d2c425e9a7c /common/env_nand.c
parentc9f7351b5bb70d292f6b0baaf0e21366e0b0b163 (diff)
downloadu-boot-53504a278900939e197d8c35164c27ffee861691.tar.gz
NAND: formatting cleanups from env.oob support
Change if (ok) { bunch of stuff } else { error } to if (error) { get out } proceed with bunch of stuff Plus a few whitespace cleanups. Signed-off-by: Scott Wood <scottwood@freescale.com>
Diffstat (limited to 'common/env_nand.c')
-rw-r--r--common/env_nand.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/common/env_nand.c b/common/env_nand.c
index 47d9848acb..a5e1038315 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -299,23 +299,21 @@ int get_nand_env_oob(nand_info_t *nand, unsigned long *result)
ops.oobbuf = (void *) oob_buf;
ret = nand->read_oob(nand, ENV_OFFSET_SIZE, &ops);
+ if (ret) {
+ printf("error reading OOB block 0\n");
+ return ret;
+ }
- if (!ret) {
- if (oob_buf[0] == ENV_OOB_MARKER) {
- *result = oob_buf[1] * nand->erasesize;
- } else if (oob_buf[0] == ENV_OOB_MARKER_OLD) {
- *result = oob_buf[1];
- } else {
- printf("No dynamic environment marker in OOB block 0"
- "\n");
- ret = -ENOENT;
- goto fail;
- }
+ if (oob_buf[0] == ENV_OOB_MARKER) {
+ *result = oob_buf[1] * nand->erasesize;
+ } else if (oob_buf[0] == ENV_OOB_MARKER_OLD) {
+ *result = oob_buf[1];
} else {
- printf("error reading OOB block 0\n");
+ printf("No dynamic environment marker in OOB block 0\n");
+ return -ENOENT;
}
-fail:
- return ret;
+
+ return 0;
}
#endif