diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-03-23 12:48:44 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-03-23 12:51:48 +0100 |
commit | 7f013062c212078c83f85ecc1ce5329d6d9d487c (patch) | |
tree | 1217ccede1e31542c8ef62e4cef6542f4a1aa7be /pbl | |
parent | bea0ec68ed1e5a1a2243de8c92077c766e9cefae (diff) | |
download | barebox-7f013062c212078c83f85ecc1ce5329d6d9d487c.tar.gz barebox-7f013062c212078c83f85ecc1ce5329d6d9d487c.tar.xz |
pbl: Implement dev_printf()
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>
Diffstat (limited to 'pbl')
-rw-r--r-- | pbl/console.c | 15 |
1 files changed, 15 insertions, 0 deletions
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; |