summaryrefslogtreecommitdiff
path: root/common/hwconfig.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-12-16 23:00:53 +0100
committerWolfgang Denk <wd@denx.de>2010-12-16 23:00:53 +0100
commit006915fbb0e3c1c9927fe32c4e92cb011f8499e7 (patch)
treeb477df920f7d638a0472aa1d6bfa5ff71243448c /common/hwconfig.c
parent98e69567022eb2138dd99554b3a2e80522a1b153 (diff)
parentb5d58d8500bfb918c7fec56f241e6ee1078c2be0 (diff)
downloadu-boot-imx-006915fbb0e3c1c9927fe32c4e92cb011f8499e7.zip
u-boot-imx-006915fbb0e3c1c9927fe32c4e92cb011f8499e7.tar.gz
u-boot-imx-006915fbb0e3c1c9927fe32c4e92cb011f8499e7.tar.bz2
Merge branch 'master' of ../master into next
Diffstat (limited to 'common/hwconfig.c')
-rw-r--r--common/hwconfig.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/common/hwconfig.c b/common/hwconfig.c
index 3c9759f..193863a 100644
--- a/common/hwconfig.c
+++ b/common/hwconfig.c
@@ -68,14 +68,14 @@ next:
return NULL;
}
-const char *cpu_hwconfig __attribute__((weak));
-const char *board_hwconfig __attribute__((weak));
+const char cpu_hwconfig[] __attribute__((weak)) = "";
+const char board_hwconfig[] __attribute__((weak)) = "";
#define HWCONFIG_PRE_RELOC_BUF_SIZE 128
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];
if (gd->flags & GD_FLG_ENV_READY) {
@@ -92,19 +92,20 @@ static const char *__hwconfig(const char *opt, size_t *arglen)
env_hwconfig = buf;
}
- if (env_hwconfig)
- return hwconfig_parse(env_hwconfig, strlen(env_hwconfig),
+ if (env_hwconfig) {
+ ret = hwconfig_parse(env_hwconfig, strlen(env_hwconfig),
opt, ";", ':', arglen);
+ if (ret)
+ return ret;
+ }
- if (board_hwconfig)
- return hwconfig_parse(board_hwconfig, strlen(board_hwconfig),
- opt, ";", ':', arglen);
+ ret = hwconfig_parse(board_hwconfig, strlen(board_hwconfig),
+ opt, ";", ':', arglen);
+ if (ret)
+ return ret;
- if (cpu_hwconfig)
- return hwconfig_parse(cpu_hwconfig, strlen(cpu_hwconfig),
- opt, ";", ':', arglen);
-
- return NULL;
+ return hwconfig_parse(cpu_hwconfig, strlen(cpu_hwconfig),
+ opt, ";", ':', arglen);
}
/*