[PATCH] lib/vsprintf: Reinstate printing of legacy clock IDs

From: Geert Uytterhoeven
Date: Mon Jul 01 2019 - 10:00:13 EST


When using the legacy clock framework, clock pointers are no longer
printed as IDs, as the !CONFIG_COMMON_CLK case was accidentally
considered an error case.

Fix this by reverting to the old behavior, which allows to distinguish
clocks by ID, as the legacy clock framework does not store names with
clocks.

Fixes: 0b74d4d763fd4ee9 ("vsprintf: Consolidate handling of unknown pointer specifiers")
Signed-off-by: Geert Uytterhoeven <geert+renesas@xxxxxxxxx>
---
The line reverted was modified later by commit c8c3b584343cb752
("vsprintf: Limit the length of inlined error messages").
Both commits entered upstream in v5.2-rc1, though.
---
lib/vsprintf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 63937044c57d5585..bc96b1cdb36727ff 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1799,7 +1799,7 @@ char *clock(char *buf, char *end, struct clk *clk, struct printf_spec spec,
#ifdef CONFIG_COMMON_CLK
return string(buf, end, __clk_get_name(clk), spec);
#else
- return error_string(buf, end, "(%pC?)", spec);
+ return ptr_to_id(buf, end, clk, spec);
#endif
}
}
--
2.17.1