[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN][RFC PATCH 06/13] device tree: Add dt_print_node_names()


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
  • Date: Wed, 1 Sep 2021 23:05:56 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qQqiWML3nRBgAmoYFeaXNgx+nXTK27DqgxYrbIIxS+4=; b=Fw8d6SeJXhmuguBjdLmY99Wwotpio0YOuUCFzzVbWSn+WsIQaw4+4/CeKH2+ruwASa4t4P2CBfm1eWis+A9Uy1jITMljZaBBxM0on3nZYre/UuU2+fHY/s3FJouDH7ZhcAfVxHURiBjTSmwlqfJsEzuuCSrEwe5Sb8RwckxRINNhzAo217+b8dQrxL8N4chvAg7CYjGXuJT97QB8GHRd3D9mAudWhgDyeJuEMfHAqcwkFiH2TTGsIicLmuKHlHKZqoBa/YP2b3l54n27o6ORY8ZHItHEsS/LB0NAxaMsXrldiyT0spy8UxYr0LrxHGt81H3kEHWLZtul+7voG8uHCw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gQLsUwitGlfNT7El7H4B/XS7vcpOlCuP/nodYDXRqQkXDeLL04P0W7cYSfDMKGPtH0AbUkmZFOX5nWIdLeZy6vWnUNESCqlg6nQzfS4ht43yxzw2uTaYy9KN1e88ohU+8r0KfXBxfqfxo97N1fcCiJAsl1nvZOzEiFxz1nZyzg6WLGQPOZrg35nUqc84G3fsTGCMoagz1SDvySFGmu875Brmw6ZgRgooquKEXkZUdDUaW737wPQjEzy5QO5Jpluxd6IPhCoJAeIhUVn5nQH81XdrXf3T5jtxMe0WszjetHKnjU+cuqGb5d5rJPNN1y6gaDkZeCNIewxuaMq3I346kA==
  • Cc: <sstabellini@xxxxxxxxxx>, <julien@xxxxxxx>, Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
  • Delivery-date: Thu, 02 Sep 2021 06:51:00 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Add dt_print_node_names() to print all nodes under a dt_device_node.
dt_print_node_names() takes a dt_device_node type input and prints the node name
of all the subsequent nodes. This is added for debugging purpose for device tree
overlays.

Signed-off-by: Vikram Garhwal <fnu.vikram@xxxxxxxxxx>
---
 xen/common/device_tree.c      | 10 ++++++++++
 xen/include/xen/device_tree.h |  5 +++++
 2 files changed, 15 insertions(+)

diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c
index cda21be..bfe3191 100644
--- a/xen/common/device_tree.c
+++ b/xen/common/device_tree.c
@@ -308,6 +308,16 @@ struct dt_device_node *dt_find_node_by_path(const char 
*path)
     return np;
 }
 
+void dt_print_node_names(struct dt_device_node *dt)
+{
+    struct dt_device_node *np;
+
+    dt_for_each_device_node(dt, np)
+        dt_dprintk("Node name: %s Full name %s\n", np->name, np->full_name);
+
+    return;
+}
+
 int dt_find_node_by_gpath(XEN_GUEST_HANDLE(char) u_path, uint32_t u_plen,
                           struct dt_device_node **node)
 {
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index a4e98a7..dcd96b4 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -483,6 +483,11 @@ struct dt_device_node *dt_find_node_by_path(const char 
*path);
 int dt_find_node_by_gpath(XEN_GUEST_HANDLE(char) u_path, uint32_t u_plen,
                           struct dt_device_node **node);
 
+/*
+ * Prints all node names.
+ */
+void dt_print_node_names(struct dt_device_node *dt);
+
 /**
  * dt_get_parent - Get a node's parent if any
  * @node: Node to get parent
-- 
2.7.4




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.