From 3bd32d6a2ee62db3c5b06caf7b163b6a4d459ea1 Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Thu, 3 Oct 2019 15:32:18 +0300 Subject: lib/vsprintf: Add %pfw conversion specifier for printing fwnode names Add support for %pfw conversion specifier (with "f" and "P" modifiers) to support printing full path of the node, including its name ("f") and only the node's name ("P") in the printk family of functions. The two flags have equivalent functionality to existing %pOF with the same two modifiers ("f" and "P") on OF based systems. The ability to do the same on ACPI based systems is added by this patch. On ACPI based systems the resulting strings look like \_SB.PCI0.CIO2.port@1.endpoint@0 where the nodes are separated by a dot (".") and the first three are ACPI device nodes and the latter two ACPI data nodes. Signed-off-by: Sakari Ailus Reviewed-by: Andy Shevchenko Reviewed-by: Petr Mladek Signed-off-by: Rafael J. Wysocki --- Documentation/core-api/printk-formats.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'Documentation/core-api/printk-formats.rst') diff --git a/Documentation/core-api/printk-formats.rst b/Documentation/core-api/printk-formats.rst index 0c081edbe97e..a6df7e99e6c9 100644 --- a/Documentation/core-api/printk-formats.rst +++ b/Documentation/core-api/printk-formats.rst @@ -418,6 +418,30 @@ Examples:: Passed by reference. +Fwnode handles +-------------- + +:: + + %pfw[fP] + +For printing information on fwnode handles. The default is to print the full +node name, including the path. The modifiers are functionally equivalent to +%pOF above. + + - f - full name of the node, including the path + - P - the name of the node including an address (if there is one) + +Examples (ACPI):: + + %pfwf \_SB.PCI0.CIO2.port@1.endpoint@0 - Full node name + %pfwP endpoint@0 - Node name + +Examples (OF):: + + %pfwf /ocp@68000000/i2c@48072000/camera@10/port/endpoint - Full name + %pfwP endpoint - Node name + Time and date (struct rtc_time) ------------------------------- -- cgit