[PATCH] pbl: Implement dev_printf()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Using dev_err() and friends in PBL results in undefined references.
Implement dev_printf() for PBL to avoid that. Just ignore the dev
argument here as it's likely not intialized in PBL.

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 pbl/console.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/pbl/console.c b/pbl/console.c
index a147e2a19e..1a6e839c15 100644
--- a/pbl/console.c
+++ b/pbl/console.c
@@ -79,6 +79,21 @@ int pr_print(int level, const char *fmt, ...)
 	return i;
 }
 
+int dev_printf(int level, const struct device *dev, const char *fmt, ...)
+{
+	va_list args;
+	uint i;
+	char printbuffer[CFG_PBSIZE];
+
+	va_start(args, fmt);
+	i = vsnprintf(printbuffer, sizeof(printbuffer), fmt, args);
+	va_end(args);
+
+	console_puts(CONSOLE_STDERR, printbuffer);
+
+	return i;
+}
+
 int ctrlc(void)
 {
 	return 0;
-- 
2.30.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux