summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorOleksij Rempel <o.rempel@pengutronix.de>2022-04-13 10:22:04 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-04-19 09:11:04 +0200
commitf50be0f9b97774191fef73585a4454f73b2ded67 (patch)
treeb4d107964a8b751a1ac9975318287c2510830599 /include
parent7bd31f674b825ea733c88699bb44358cc7203d6c (diff)
downloadbarebox-f50be0f9b97774191fef73585a4454f73b2ded67.tar.gz
barebox-f50be0f9b97774191fef73585a4454f73b2ded67.tar.xz
hexdump: provide support for dev_print_hex_dump()
In some cases we need to know the interface name of dumped hex. So, provide optional device_d pointer and use it to get device name. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de> Link: https://lore.barebox.org/20220413082205.429509-14-o.rempel@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/printk.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/include/printk.h b/include/printk.h
index 046b456a9d..8de8202af9 100644
--- a/include/printk.h
+++ b/include/printk.h
@@ -4,6 +4,8 @@
#include <linux/types.h>
+struct device_d;
+
#define KERN_EMERG "" /* system is unusable */
#define KERN_ALERT "" /* action must be taken immediately */
#define KERN_CRIT "" /* critical conditions */
@@ -45,9 +47,15 @@ enum {
extern int hex_dump_to_buffer(const void *buf, size_t len, int rowsize,
int groupsize, char *linebuf, size_t linebuflen,
bool ascii);
-extern void print_hex_dump(const char *level, const char *prefix_str,
- int prefix_type, int rowsize, int groupsize,
- const void *buf, size_t len, bool ascii);
+extern void dev_print_hex_dump(struct device_d *dev, const char *level,
+ const char *prefix_str, int prefix_type,
+ int rowsize, int groupsize, const void *buf,
+ size_t len, bool ascii);
+
+#define print_hex_dump(level, prefix_str, prefix_type, rowsize, \
+ groupsize, buf, len, ascii) \
+ dev_print_hex_dump(NULL, level, prefix_str, prefix_type, rowsize, \
+ groupsize, buf, len, ascii)
#ifdef CONFIG_ARCH_HAS_STACK_DUMP
void dump_stack(void);