From fbb191fd416de27148bc977c320e07c95b4ca36c Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 8 Oct 2014 08:05:44 +0200 Subject: console: Fix CONSOLE_NONE support Without console support we need a static inline version of pr_print and dev_printf, otherwise we get link errors. Reported-by: Kevin Du Huanpeng Signed-off-by: Sascha Hauer --- include/printk.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/printk.h b/include/printk.h index fb635868ab..22c6c732f7 100644 --- a/include/printk.h +++ b/include/printk.h @@ -21,11 +21,23 @@ /* debugging and troubleshooting/diagnostic helpers. */ +#ifndef CONFIG_CONSOLE_NONE int pr_print(int level, const char *format, ...) __attribute__ ((format(__printf__, 2, 3))); int dev_printf(int level, const struct device_d *dev, const char *format, ...) __attribute__ ((format(__printf__, 3, 4))); +#else +static inline int pr_print(int level, const char *format, ...) +{ + return 0; +} + +static inline int dev_printf(int level, const struct device_d *dev, const char *format, ...) +{ + return 0; +} +#endif #define __dev_printf(level, dev, format, args...) \ ({ \ -- cgit v1.2.3