All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: xen-devel@lists.xen.org
Cc: "Viresh Kumar" <viresh.kumar@linaro.org>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Stefano Stabellini" <stefano.stabellini@xilinx.com>,
	"Mathieu Poirier" <mathieu.poirier@linaro.com>,
	"Oleksandr Tyshchenko" <olekstysh@gmail.com>,
	"Wei Liu" <wl@xen.org>, "Juergen Gross" <jgross@suse.com>,
	"Julien Grall" <julien@xen.org>,
	"Anthony PERARD" <anthony.perard@citrix.com>,
	"Oleksandr Tyshchenko" <oleksandr_tyshchenko@epam.com>
Subject: [PATCH V6 2/3] libxl: arm: Split make_virtio_mmio_node()
Date: Thu,  8 Sep 2022 14:23:00 +0530	[thread overview]
Message-ID: <0edb5dc1ea3308cf9202e6476ff2797aad953966.1662626550.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1662626550.git.viresh.kumar@linaro.org>

make_virtio_mmio_node() creates the DT node for simple MMIO devices
currently, i.e. the ones that don't require any additional properties.

In order to allow using it for other complex device types, split the
functionality into two, one where the fdt node isn't closed and the
other one to create a simple DT node.

Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 tools/libs/light/libxl_arm.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/tools/libs/light/libxl_arm.c b/tools/libs/light/libxl_arm.c
index cc30ba124918..55aee15c10b4 100644
--- a/tools/libs/light/libxl_arm.c
+++ b/tools/libs/light/libxl_arm.c
@@ -907,9 +907,9 @@ static int make_xen_iommu_node(libxl__gc *gc, void *fdt)
     return 0;
 }
 
-static int make_virtio_mmio_node(libxl__gc *gc, void *fdt,
-                                 uint64_t base, uint32_t irq,
-                                 uint32_t backend_domid)
+/* The caller is responsible to complete / close the fdt node */
+static int make_virtio_mmio_node_common(libxl__gc *gc, void *fdt, uint64_t base,
+                                        uint32_t irq, uint32_t backend_domid)
 {
     int res;
     gic_interrupt intr;
@@ -942,10 +942,18 @@ static int make_virtio_mmio_node(libxl__gc *gc, void *fdt,
         if (res) return res;
     }
 
-    res = fdt_end_node(fdt);
+    return res;
+}
+
+static int make_virtio_mmio_node(libxl__gc *gc, void *fdt, uint64_t base,
+                                 uint32_t irq, uint32_t backend_domid)
+{
+    int res;
+
+    res = make_virtio_mmio_node_common(gc, fdt, base, irq, backend_domid);
     if (res) return res;
 
-    return 0;
+    return fdt_end_node(fdt);
 }
 
 static const struct arch_info *get_arch_info(libxl__gc *gc,
-- 
2.31.1.272.g89b43f80a514



  parent reply	other threads:[~2022-09-08  8:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08  8:52 [PATCH V6 0/3] libxl: arm: Make generic code independent of disk device Viresh Kumar
2022-09-08  8:52 ` [PATCH V6 1/3] libxl: arm: Create alloc_virtio_mmio_params() Viresh Kumar
2022-09-09 13:19   ` Anthony PERARD
2022-09-08  8:53 ` Viresh Kumar [this message]
2022-09-09 13:21   ` [PATCH V6 2/3] libxl: arm: Split make_virtio_mmio_node() Anthony PERARD
2022-09-08  8:53 ` [PATCH V6 3/3] libxl: arm: make creation of iommu node independent of disk device Viresh Kumar
2022-09-09 13:47   ` Anthony PERARD
2022-09-09 14:43   ` [PATCH V6.1 " Viresh Kumar
2022-09-09 15:02     ` Anthony PERARD
2022-09-20 10:29       ` Viresh Kumar
2022-10-04  9:59         ` Julien Grall
2022-11-24 19:19           ` Julien Grall
2022-11-25  5:45             ` Viresh Kumar
2022-11-28  9:31               ` Julien Grall
2022-09-16 10:21     ` Oleksandr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0edb5dc1ea3308cf9202e6476ff2797aad953966.1662626550.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=anthony.perard@citrix.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=mathieu.poirier@linaro.com \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=olekstysh@gmail.com \
    --cc=stefano.stabellini@xilinx.com \
    --cc=stratos-dev@op-lists.linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.