From: Marc Kleine-Budde <mkl@pengutronix.de>
To: barebox@lists.infradead.org
Cc: sha@pengutronix.de
Subject: [PATCH 2/5] i.MX habv4: convert habv4_get_status() and habv4_display_event() from printf to pr_err()
Date: Mon, 27 Aug 2018 17:14:25 +0200 [thread overview]
Message-ID: <20180827151428.3032-3-mkl@pengutronix.de> (raw)
In-Reply-To: <20180827151428.3032-1-mkl@pengutronix.de>
This way the events will be printed into the dmesg buffer,
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/hab/habv4.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/drivers/hab/habv4.c b/drivers/hab/habv4.c
index 9ccec7847d9f..4d2d377d084a 100644
--- a/drivers/hab/habv4.c
+++ b/drivers/hab/habv4.c
@@ -163,17 +163,17 @@ static void habv4_display_event(uint8_t *data, uint32_t len)
if (data && len) {
for (i = 0; i < len; i++) {
- if (i == 0)
- printf(" %02x", data[i]);
- else if ((i % 8) == 0)
- printf("\n %02x", data[i]);
+ if ((i % 8) == 0)
+ pr_err(" %02x", data[i]);
else if ((i % 4) == 0)
- printf(" %02x", data[i]);
+ pr_cont(" %02x", data[i]);
+ else if ((i % 8) == 7)
+ pr_cont(" %02x\n", data[i]);
else
- printf(" %02x", data[i]);
+ pr_cont(" %02x", data[i]);
}
+ pr_cont("\n");
}
- printf("\n\n");
}
static int habv4_get_status(const struct habv4_rvt *rvt)
@@ -201,8 +201,8 @@ static int habv4_get_status(const struct habv4_rvt *rvt)
}
while (rvt->report_event(HAB_STATUS_FAILURE, index, data, &len) == HAB_STATUS_SUCCESS) {
- printf("-------- HAB Event %d --------\n"
- "event data:\n", index);
+ pr_err("-------- HAB Event %d --------\n", index);
+ pr_err("event data:\n");
habv4_display_event(data, len);
len = sizeof(data);
--
2.18.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2018-08-27 15:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-27 15:14 [PATCH 0/5] i.MX habv4: decode error/warning events and support new CST version Marc Kleine-Budde
2018-08-27 15:14 ` [PATCH 1/5] i.MX habv4: properly indent defines and enums Marc Kleine-Budde
2018-08-27 15:14 ` Marc Kleine-Budde [this message]
2018-08-27 15:14 ` [PATCH 3/5] i.MX habv4: habv4_get_status(): display warning events, too Marc Kleine-Budde
2018-08-27 15:14 ` [PATCH 4/5] i.MX habv4: habv4_display_event_record(): Add function to decode event record Marc Kleine-Budde
2018-08-27 15:14 ` [PATCH 5/5] scripts imx-image: add support for newer versions of "cst" Marc Kleine-Budde
2018-08-29 7:15 ` Sascha Hauer
2018-08-29 7:29 ` Marc Kleine-Budde
2018-08-29 7:59 ` Sascha Hauer
2018-08-29 7:17 ` [PATCH 0/5] i.MX habv4: decode error/warning events and support new CST version Sascha Hauer
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=20180827151428.3032-3-mkl@pengutronix.de \
--to=mkl@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=sha@pengutronix.de \
/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