diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2008-10-31 14:02:25 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2008-10-31 14:02:25 +0100 |
commit | c3fc1364d9ed508a59bc2127c04d7239e30d148a (patch) | |
tree | 44b43ff8a77ae69ff4ec98e3216de54d79dec6c8 /include/common.h | |
parent | dff84a542281c46076a0c8c5f589b1df4777ade8 (diff) | |
download | barebox-c3fc1364d9ed508a59bc2127c04d7239e30d148a.tar.gz barebox-c3fc1364d9ed508a59bc2127c04d7239e30d148a.tar.xz |
Introduce dev_* and pr_* functions
Proven to be useful in linux kernel, U-Boot should have such a thing
aswell. We do not distinguish between the various print levels others
than debug and not debug.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/common.h')
-rw-r--r-- | include/common.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/include/common.h b/include/common.h index 699d971743..46efc8be3b 100644 --- a/include/common.h +++ b/include/common.h @@ -33,13 +33,21 @@ #include <linux/kernel.h> #include <asm/common.h> -#ifdef DEBUG -#define debug(fmt,args...) printf (fmt ,##args) -#define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args); +#define pr_info(fmt, arg...) printf(fmt, ##arg) +#define pr_notice(fmt, arg...) printf(fmt, ##arg) +#define pr_err(fmt, arg...) printf(fmt, ##arg) +#define pr_warning(fmt, arg...) printf(fmt, ##arg) +#define pr_crit(fmt, arg...) printf(fmt, ##arg) +#define pr_alert(fmt, arg...) printf(fmt, ##arg) +#define pr_emerg(fmt, arg...) printf(fmt, ##arg) + +#ifdef DEBUG +#define pr_debug(fmt, arg...) printf(UBOOT_DEBUG, fmt, ##arg) #else -#define debug(fmt,args...) -#define debugX(level,fmt,args...) -#endif /* DEBUG */ +#define pr_debug(fmt, arg...) do {} while(0) +#endif + +#define debug(fmt, arg...) pr_debug(fmt, ##arg) #define BUG() do { \ printf("BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \ |