summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-10-08 08:05:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-10-08 08:05:49 +0200
commitfbb191fd416de27148bc977c320e07c95b4ca36c (patch)
tree2cbad542a219d233f1401d9b83f0aa1c8550d4a5
parent3b0b8281866bf891465bd4e1d66705a562c3d53d (diff)
downloadbarebox-fbb191fd416de27148bc977c320e07c95b4ca36c.tar.gz
barebox-fbb191fd416de27148bc977c320e07c95b4ca36c.tar.xz
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 <u74147@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--include/printk.h12
1 files changed, 12 insertions, 0 deletions
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...) \
({ \