Patchwork [U-Boot,10/11] a3m071: Make spl_start_uboot test like getenv_yesno does

login
register
mail settings
Submitter Tom Rini
Date Sept. 26, 2013, 8:28 p.m.
Message ID <1380227287-26057-11-git-send-email-trini@ti.com>
Download mbox | patch
Permalink /patch/278267/
State Superseded
Delegated to: Tom Rini
Headers show

Comments

Tom Rini - Sept. 26, 2013, 8:28 p.m.
This change makes the behaviour slightly more rebust and will match
other implementations which can use getenv_yesno directly.

Cc: Stefan Roese <sr@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
---
 board/a3m071/a3m071.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Stefan Roese - Sept. 27, 2013, 7:04 a.m.
On 26.09.2013 22:28, Tom Rini wrote:
> This change makes the behaviour slightly more rebust and will match
> other implementations which can use getenv_yesno directly.
> 
> Cc: Stefan Roese <sr@denx.de>
> Signed-off-by: Tom Rini <trini@ti.com>

I see the benefit by this generalization. So:

Acked-by: Stefan Roese <sr@denx.de>

Thanks,
Stefan

Patch

diff --git a/board/a3m071/a3m071.c b/board/a3m071/a3m071.c
index 7aeefb2..b96ba81 100644
--- a/board/a3m071/a3m071.c
+++ b/board/a3m071/a3m071.c
@@ -412,7 +412,8 @@  int spl_start_uboot(void)
 
 	env_init();
 	getenv_f("boot_os", s, sizeof(s));
-	if ((s != NULL) && (strcmp(s, "yes") == 0))
+	if ((s != NULL) && (*s == '1' || *s == 'y' || *s == 'Y' ||
+			    *s == 't' || *s == 'T'))
 		return 0;
 
 	return 1;