parse RedBoot environments as well (patch by Jonas <jmajau@ubnt.com>)

SVN-Revision: 14384
This commit is contained in:
Gabor Juhos 2009-02-03 08:44:50 +00:00
parent 9e624a7144
commit 43ed2ff89d
1 changed files with 7 additions and 1 deletions

View File

@ -115,10 +115,16 @@ static __init char *ar71xx_prom_getenv(const char *envname)
if (!is_valid_ram_addr(ar71xx_prom_envp))
return NULL;
for (env = ar71xx_prom_envp; is_valid_ram_addr(*env); env++)
for (env = ar71xx_prom_envp; is_valid_ram_addr(*env); env++) {
if (strncmp(envname, *env, len) == 0 && (*env)[len] == '=')
return *env + len + 1;
/* RedBoot env comes in pointer pairs - key, value */
if (strncmp(envname, *env, len) == 0 && (*env)[len] == 0)
if (is_valid_ram_addr(*(++env)))
return *env;
}
return NULL;
}