From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH] pbl: Implement dev_printf()
Date: Thu, 23 Mar 2023 12:51:17 +0100 [thread overview]
Message-ID: <20230323115117.2574352-1-s.hauer@pengutronix.de> (raw)
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
reply other threads:[~2023-03-23 11:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230323115117.2574352-1-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox