diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-17 16:07:18 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-17 16:07:18 +0100 |
commit | d4d9c75f96dccd673104ada4a9a19149325ace89 (patch) | |
tree | 49dea856fd9c13c1e6f9c82d09829e93e24dbe37 /lib | |
parent | 26b942ded55dda5a701c9fd01d5ac771cab3578e (diff) | |
parent | 905e124f1c476f79d863e028934c6881ee4ee3be (diff) | |
download | barebox-d4d9c75f96dccd673104ada4a9a19149325ace89.tar.gz barebox-d4d9c75f96dccd673104ada4a9a19149325ace89.tar.xz |
Merge branch 'for-next/kernelcode-helpers' into HEAD
Diffstat (limited to 'lib')
-rw-r--r-- | lib/vsprintf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/vsprintf.c b/lib/vsprintf.c index 693f3c0cc0..1291cf7dd9 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -19,6 +19,7 @@ #include <malloc.h> #include <kallsyms.h> #include <wchar.h> +#include <of.h> #include <common.h> #include <pbl.h> @@ -391,6 +392,14 @@ char *address_val(char *buf, const char *end, const void *addr, return number(buf, end, num, 16, field_width, precision, flags); } +static noinline_for_stack +char *device_node_string(char *buf, const char *end, const struct device_node *np, + int field_width, int precision, int flags, const char *fmt) +{ + return string(buf, end, of_node_full_name(np), field_width, + precision, flags); +} + /* * Show a '%p' thing. A kernel extension is that the '%p' is followed * by an extra set of alphanumeric characters that are extended format @@ -454,6 +463,10 @@ static char *pointer(const char *fmt, char *buf, const char *end, const void *pt break; case 'e': return error_string(buf, end, ptr, field_width, precision, flags, fmt); + case 'O': + if (IS_ENABLED(CONFIG_OFTREE)) + return device_node_string(buf, end, ptr, field_width, precision, flags, fmt + 1); + break; case 'h': if (IS_ENABLED(CONFIG_PRINTF_HEXSTR)) return hex_string(buf, end, ptr, field_width, precision, flags, fmt); |