summaryrefslogtreecommitdiffstats
path: root/lib/hexdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/hexdump.c')
-rw-r--r--lib/hexdump.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/hexdump.c b/lib/hexdump.c
index 033e1d28d1..ae078536e3 100644
--- a/lib/hexdump.c
+++ b/lib/hexdump.c
@@ -10,6 +10,7 @@
#include <linux/log2.h>
#include <linux/printk.h>
#include <asm/unaligned.h>
+#include <pbl.h>
const char hex_asc[] = "0123456789abcdef";
EXPORT_SYMBOL(hex_asc);
@@ -236,16 +237,20 @@ EXPORT_SYMBOL(hex_dump_to_buffer);
* Example output using %DUMP_PREFIX_ADDRESS and 4-byte mode:
* ffffffff88089af0: 73727170 77767574 7b7a7978 7f7e7d7c pqrstuvwxyz{|}~.
*/
-void dev_print_hex_dump(struct device_d *dev, const char *level,
+void dev_print_hex_dump(struct device *dev, const char *level,
const char *prefix_str, int prefix_type, int rowsize,
int groupsize, const void *buf, size_t len, bool ascii)
{
const u8 *ptr = buf;
int i, linelen, remaining = len;
unsigned char linebuf[32 * 3 + 2 + 32 + 1];
- char *name;
+ char *name = "";
- name = basprintf("%s%s", dev ? dev_name(dev) : "", dev ? ": " : "");
+ if (IN_PBL)
+ dev = NULL;
+
+ if (dev)
+ name = basprintf("%s: ", dev_name(dev));
if (rowsize != 16 && rowsize != 32)
rowsize = 16;
@@ -273,6 +278,7 @@ void dev_print_hex_dump(struct device_d *dev, const char *level,
}
}
- free(name);
+ if (dev)
+ free(name);
}
EXPORT_SYMBOL(dev_print_hex_dump);