From: Steve Sakoman <steve@sakoman.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH - RFC] env_nand.c: fail gracefully if no nand is present
Date: Mon, 16 Aug 2010 14:30:38 -0700 [thread overview]
Message-ID: <1281994238.2052.37.camel@quadra> (raw)
Rationale:
The upcoming Beagle xM, unlike previous Beagles, has no on-board NAND.
I'd like to continue to have a single version of u-boot that works for
all version of Beagles. Therefore I need to have env_nand fail
gracefully when it runs on the xM.
The patch below does the job, but I am not sure that my method of
checking for the existence of nand (nand_info[0].type = 0 when no nand
detected) is "correct"? Any opinions or advice?
Steve
---
diff --git a/common/env_nand.c b/common/env_nand.c
index a15a950..325f112 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -268,6 +268,10 @@ int readenv (size_t offset, u_char * buf)
u_char *char_ptr;
+ /* fail if no nand detected */
+ if (nand_info[0].type == 0)
+ return 1;
+
blocksize = nand_info[0].erasesize;
len = min(blocksize, CONFIG_ENV_SIZE);
next reply other threads:[~2010-08-16 21:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 21:30 Steve Sakoman [this message]
2010-08-16 21:36 ` [U-Boot] [PATCH - RFC] env_nand.c: fail gracefully if no nand is present Scott Wood
2010-08-16 22:33 ` Steve Sakoman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1281994238.2052.37.camel@quadra \
--to=steve@sakoman.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.