diff options
author | Joe Hershberger <joe.hershberger@ni.com> | 2012-12-11 22:16:22 -0600 |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2012-12-13 11:46:55 -0700 |
commit | ec8a252cd492a7a409d6912aebeff34bb9e1e1e1 (patch) | |
tree | 346bb7bedd1dfe13f531725e7e0edaa2d80df1a8 /board/Marvell | |
parent | 7afcf3a55b5f484b3d3442053fae8186a3fb92d7 (diff) | |
download | u-boot-ec8a252cd492a7a409d6912aebeff34bb9e1e1e1.tar.gz |
env: Use getenv_yesno() more generally
Move the getenv_yesno() to env_common.c and change most checks for
'y' or 'n' to use this helper.
Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'board/Marvell')
-rw-r--r-- | board/Marvell/db64360/db64360.c | 10 | ||||
-rw-r--r-- | board/Marvell/db64460/db64460.c | 10 |
2 files changed, 6 insertions, 14 deletions
diff --git a/board/Marvell/db64360/db64360.c b/board/Marvell/db64360/db64360.c index 6cae68601d..38769e03c5 100644 --- a/board/Marvell/db64360/db64360.c +++ b/board/Marvell/db64360/db64360.c @@ -834,15 +834,11 @@ int mem_test_walk (void) /*********************************************************************/ int testdram (void) { - char *s; int rundata, runaddress, runwalk; - s = getenv ("testdramdata"); - rundata = (s && (*s == 'y')) ? 1 : 0; - s = getenv ("testdramaddress"); - runaddress = (s && (*s == 'y')) ? 1 : 0; - s = getenv ("testdramwalk"); - runwalk = (s && (*s == 'y')) ? 1 : 0; + rundata = getenv_yesno("testdramdata") == 1; + runaddress = getenv_yesno("testdramaddress") == 1; + runwalk = getenv_yesno("testdramwalk") == 1; /* rundata = 1; */ /* runaddress = 0; */ diff --git a/board/Marvell/db64460/db64460.c b/board/Marvell/db64460/db64460.c index d4f58b3216..ddb7ed5551 100644 --- a/board/Marvell/db64460/db64460.c +++ b/board/Marvell/db64460/db64460.c @@ -834,15 +834,11 @@ int mem_test_walk (void) /*********************************************************************/ int testdram (void) { - char *s; int rundata, runaddress, runwalk; - s = getenv ("testdramdata"); - rundata = (s && (*s == 'y')) ? 1 : 0; - s = getenv ("testdramaddress"); - runaddress = (s && (*s == 'y')) ? 1 : 0; - s = getenv ("testdramwalk"); - runwalk = (s && (*s == 'y')) ? 1 : 0; + rundata = getenv_yesno("testdramdata") == 1; + runaddress = getenv_yesno("testdramaddress") == 1; + runwalk = getenv_yesno("testdramwalk") == 1; /* rundata = 1; */ /* runaddress = 0; */ |