diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-01 09:37:37 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-01 09:37:37 +0200 |
commit | 85b427ffedfe19f0810808b6739e77be54112170 (patch) | |
tree | 07620b46336fdc6fb6a564a03479197c91f07066 /common | |
parent | 2720526fa4c0c3b02891a419451b6f1bf8b768a5 (diff) | |
parent | 2177c1c20c83543e559b404208aee21ff4cf037c (diff) | |
download | barebox-85b427ffedfe19f0810808b6739e77be54112170.tar.gz barebox-85b427ffedfe19f0810808b6739e77be54112170.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common')
-rw-r--r-- | common/misc.c | 17 | ||||
-rw-r--r-- | common/module.c | 3 | ||||
-rw-r--r-- | common/version.c | 10 |
3 files changed, 18 insertions, 12 deletions
diff --git a/common/misc.c b/common/misc.c index e9fdacc655..806649431d 100644 --- a/common/misc.c +++ b/common/misc.c @@ -125,3 +125,20 @@ EXPORT_SYMBOL(perror); void (*do_execute)(void *func, int argc, char *argv[]); EXPORT_SYMBOL(do_execute); + +static const char *boardinfo; + +const char *barebox_boardinfo(void) +{ + if (boardinfo) + return boardinfo; + + boardinfo = of_get_model(); + if (boardinfo) + boardinfo = xstrdup(boardinfo); + else + boardinfo = CONFIG_BOARDINFO; + + return boardinfo; +} +EXPORT_SYMBOL(barebox_boardinfo); diff --git a/common/module.c b/common/module.c index 109fe5cd00..eb882bce31 100644 --- a/common/module.c +++ b/common/module.c @@ -129,9 +129,6 @@ static int simplify_symbols(Elf32_Shdr *sechdrs, return ret; } -#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) -#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) - /* Update size with this section: return offset. */ static long get_offset(unsigned long *size, Elf32_Shdr *sechdr) { diff --git a/common/version.c b/common/version.c index d33f4d0078..e21dbbedfa 100644 --- a/common/version.c +++ b/common/version.c @@ -1,7 +1,6 @@ #include <common.h> #include <generated/compile.h> #include <generated/utsrelease.h> -#include <of.h> const char version_string[] = "barebox " UTS_RELEASE " " UTS_VERSION "\n"; @@ -9,13 +8,6 @@ EXPORT_SYMBOL(version_string); void barebox_banner (void) { - const char *board; - - board = of_get_model(); - - if (!board) - board = CONFIG_BOARDINFO; - pr_info("\n\n%s\n\n", version_string); - pr_info("Board: %s\n", board); + pr_info("Board: %s\n", barebox_boardinfo()); } |