* [PATCH] pbl: Implement dev_printf()
@ 2023-03-23 11:51 Sascha Hauer
0 siblings, 0 replies; only message in thread
From: Sascha Hauer @ 2023-03-23 11:51 UTC (permalink / raw)
To: Barebox List
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@pengutronix.de>
---
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-23 11:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-23 11:51 [PATCH] pbl: Implement dev_printf() Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox