summaryrefslogtreecommitdiff
path: root/board/esd
diff options
context:
space:
mode:
authorJoe Hershberger <joe.hershberger@ni.com>2012-12-11 22:16:22 -0600
committerTom Rini <trini@ti.com>2012-12-13 11:46:55 -0700
commitec8a252cd492a7a409d6912aebeff34bb9e1e1e1 (patch)
tree346bb7bedd1dfe13f531725e7e0edaa2d80df1a8 /board/esd
parent7afcf3a55b5f484b3d3442053fae8186a3fb92d7 (diff)
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/esd')
-rw-r--r--board/esd/cpci750/cpci750.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/board/esd/cpci750/cpci750.c b/board/esd/cpci750/cpci750.c
index 98051fb3fbe..d7deae4a541 100644
--- a/board/esd/cpci750/cpci750.c
+++ b/board/esd/cpci750/cpci750.c
@@ -953,22 +953,18 @@ int mem_test_walk (void)
/*********************************************************************/
int testdram (void)
{
- char *s;
int rundata = 0;
int runaddress = 0;
int runwalk = 0;
#ifdef CONFIG_SYS_DRAM_TEST_DATA
- s = getenv ("testdramdata");
- rundata = (s && (*s == 'y')) ? 1 : 0;
+ rundata = getenv_yesno("testdramdata") == 1;
#endif
#ifdef CONFIG_SYS_DRAM_TEST_ADDRESS
- s = getenv ("testdramaddress");
- runaddress = (s && (*s == 'y')) ? 1 : 0;
+ runaddress = getenv_yesno("testdramaddress") == 1;
#endif
#ifdef CONFIG_SYS_DRAM_TEST_WALK
- s = getenv ("testdramwalk");
- runwalk = (s && (*s == 'y')) ? 1 : 0;
+ runwalk = getenv_yesno("testdramwalk") == 1;
#endif
if ((rundata == 1) || (runaddress == 1) || (runwalk == 1)) {