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

[PATCH 17/19] xen/dt: ifdef out DEV_DT-related bits from device_tree.{c,h}


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Alejandro Vallejo <agarciav@xxxxxxx>
  • Date: Fri, 30 May 2025 14:02:25 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=brxUSyWoWAWqxgYUG8qaIMM7Yyx7/AEhfufohTwOIXw=; b=whoI4/Yktv7McRxiKSJWf7JOBZrcYRZefilaG2gVRQI41iz/DfG493r+cB0T7a+NCgn5nRxmC6xw+tFp8qBoGj1obcwk5ljW0XCEirEc6TRyI1lkhdXITElhvbAF6S9DNQWxORbPWJjJ2HDhxW47NDkdEuvbFnCfeM2tWfQWnAAWiCp3fdC8iEBNg9SQldBYTuvu/6XdbH2fQv4ismcgWGmxh8lFcNv2q+RpvggceKTwo7KpJdf1dUUwpjodFTF1qvTHcQCV1gjTgzyYuDbMKSD3Py2ZQivVYoEsXUJ7IRhaTRvg3ZM3Sx429RFH/kIUIoNecix/ZkChsk/kYmGt+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FApZYcNUFDbA8t5TTmmWAev4Z5M7nfjSK4QuSVIuvuG4V4aq9CF484LV6SH8tPTuaExtGKXgmu/1UcsdZMAUJsT49x2uKsclR6F0wPpUubzDMLPI6nrzy120N2pi8POam8tOlL3KoeSl5dYFxDgWvy2piaRUkmo1AFyuyFLtvsSxjC+DitH6Chmyq2MPHwqNhBKVDvIpzqnqFPx3ofD4IzoexHnebCnZeov5Jk1uq2GPuvcxl3IooBUIeK6tOSMsyTABFsIoC12oOJqqilyLHDO6EJnJmGbReQ+DEo3v2ITf7tGn43FUndO/ZbVoLm5+5OTOSlOCP98Gu4U3shcsiQ==
  • Cc: Alejandro Vallejo <agarciav@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 30 May 2025 12:11:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

... which means, device-tree.c stops requiring strictly CONFIG_HAS_DEVICE_TREE
and may function without it.

Not a functional change on architectures that currently use these files,
as they already select CONFIG_HAS_DEVICE_TREE.

Signed-off-by: Alejandro Vallejo <agarciav@xxxxxxx>
---
 xen/common/device-tree/device-tree.c | 2 ++
 xen/include/xen/device_tree.h        | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/xen/common/device-tree/device-tree.c 
b/xen/common/device-tree/device-tree.c
index 886e6c7712..c8a9c0e46a 100644
--- a/xen/common/device-tree/device-tree.c
+++ b/xen/common/device-tree/device-tree.c
@@ -2028,9 +2028,11 @@ static unsigned long unflatten_dt_node(const void *fdt,
             ((char *)pp->value)[sz - 1] = 0;
             dt_dprintk("fixed up name for %s -> %s\n", pathp,
                        (char *)pp->value);
+#ifdef CONFIG_HAS_DEVICE_TREE
             /* Generic device initialization */
             np->dev.type = DEV_DT;
             np->dev.of_node = np;
+#endif /* CONFIG_HAS_DEVICE_TREE */
         }
     }
     if ( allnextpp )
diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h
index 7d1c8bc305..641f24518d 100644
--- a/xen/include/xen/device_tree.h
+++ b/xen/include/xen/device_tree.h
@@ -109,9 +109,12 @@ struct dt_device_node {
      */
     struct list_head domain_list;
 
+#ifdef CONFIG_HAS_DEVICE_TREE
     struct device dev;
+#endif /* CONFIG_HAS_DEVICE_TREE */
 };
 
+#ifdef CONFIG_HAS_DEVICE_TREE
 #define dt_to_dev(dt_node)  (&(dt_node)->dev)
 
 static inline struct dt_device_node *dev_to_dt(struct device *dev)
@@ -120,6 +123,7 @@ static inline struct dt_device_node *dev_to_dt(struct 
device *dev)
 
     return container_of(dev, struct dt_device_node, dev);
 }
+#endif /* CONFIG_HAS_DEVICE_TREE */
 
 #define MAX_PHANDLE_ARGS 16
 struct dt_phandle_args {
-- 
2.43.0




 


Rackspace

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