hwconfig: Fix handling of env_hwconfig, board_hwconfig, and cpu_hwconfig
The handling of env_hwconfig, board_hwconfig, and cpu_hwconfig got broken when we removed the boards defining dummy board_hwconfig & cpu_hwconfig values. We fix this by handling the various strings in priority order. If hwconfig_parse returns NULL for a given string we check the next one in order (env_hwconfig, board_hwconfig, followed by cpu_hwconfig). Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
This commit is contained in:
parent
296cae732b
commit
bb141079d3
|
@ -75,7 +75,7 @@ const char board_hwconfig[] __attribute__((weak)) = "";
|
||||||
|
|
||||||
static const char *__hwconfig(const char *opt, size_t *arglen)
|
static const char *__hwconfig(const char *opt, size_t *arglen)
|
||||||
{
|
{
|
||||||
const char *env_hwconfig = NULL;
|
const char *env_hwconfig = NULL, *ret;
|
||||||
char buf[HWCONFIG_PRE_RELOC_BUF_SIZE];
|
char buf[HWCONFIG_PRE_RELOC_BUF_SIZE];
|
||||||
|
|
||||||
if (gd->flags & GD_FLG_ENV_READY) {
|
if (gd->flags & GD_FLG_ENV_READY) {
|
||||||
|
@ -92,17 +92,20 @@ static const char *__hwconfig(const char *opt, size_t *arglen)
|
||||||
env_hwconfig = buf;
|
env_hwconfig = buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (env_hwconfig)
|
if (env_hwconfig) {
|
||||||
return hwconfig_parse(env_hwconfig, strlen(env_hwconfig),
|
ret = hwconfig_parse(env_hwconfig, strlen(env_hwconfig),
|
||||||
opt, ";", ':', arglen);
|
opt, ";", ':', arglen);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
return hwconfig_parse(board_hwconfig, strlen(board_hwconfig),
|
ret = hwconfig_parse(board_hwconfig, strlen(board_hwconfig),
|
||||||
opt, ";", ':', arglen);
|
opt, ";", ':', arglen);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return hwconfig_parse(cpu_hwconfig, strlen(cpu_hwconfig),
|
return hwconfig_parse(cpu_hwconfig, strlen(cpu_hwconfig),
|
||||||
opt, ";", ':', arglen);
|
opt, ";", ':', arglen);
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in New Issue