summaryrefslogtreecommitdiff
path: root/drivers/base/property.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2019-10-03 15:32:13 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-10-11 11:26:55 +0200
commite7e242bccb209b5f73455b33928b8680cc6e3319 (patch)
tree71ab6dcb21967662c41dae3fd869b421f5775b60 /drivers/base/property.c
parentbc0500c1e43d95cca5352d2345fb0769f314ba22 (diff)
device property: Add a function to obtain a node's prefix
The prefix is used for printing purpose before a node, and it also works as a separator between two nodes. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Rob Herring <robh@kernel.org> (for OF) Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/property.c')
-rw-r--r--drivers/base/property.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/base/property.c b/drivers/base/property.c
index 9b5ec88e72d8..511f6d7acdfe 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -568,6 +568,18 @@ const char *fwnode_get_name(const struct fwnode_handle *fwnode)
}
/**
+ * fwnode_get_name_prefix - Return the prefix of node for printing purposes
+ * @fwnode: The firmware node
+ *
+ * Returns the prefix of a node, intended to be printed right before the node.
+ * The prefix works also as a separator between the nodes.
+ */
+const char *fwnode_get_name_prefix(const struct fwnode_handle *fwnode)
+{
+ return fwnode_call_ptr_op(fwnode, get_name_prefix);
+}
+
+/**
* fwnode_get_parent - Return parent firwmare node
* @fwnode: Firmware whose parent is retrieved
*