qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH 7/7] hw/usb: Declare link using static DEFINE_PROP_LINK() mac


From: Mark Cave-Ayland
Subject: Re: [PATCH 7/7] hw/usb: Declare link using static DEFINE_PROP_LINK() macro
Date: Tue, 17 Oct 2023 21:19:39 +0100
User-agent: Mozilla Thunderbird

On 17/10/2023 15:01, Philippe Mathieu-Daudé wrote:

Pull the 'dma' property to the core XHCI type, declare
its link statically using DEFINE_PROP_LINK().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
  hw/usb/hcd-xhci-sysbus.c | 4 ----
  hw/usb/hcd-xhci.c        | 2 ++
  2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/hw/usb/hcd-xhci-sysbus.c b/hw/usb/hcd-xhci-sysbus.c
index faf57b4797..15983d0b96 100644
--- a/hw/usb/hcd-xhci-sysbus.c
+++ b/hw/usb/hcd-xhci-sysbus.c
@@ -60,10 +60,6 @@ static void xhci_sysbus_instance_init(Object *obj)
      object_initialize_child(obj, "xhci-core", &s->xhci, TYPE_XHCI);
      qdev_alias_all_properties(DEVICE(&s->xhci), obj);
- object_property_add_link(obj, "dma", TYPE_MEMORY_REGION,
-                             (Object **)&s->xhci.dma_mr,
-                             qdev_prop_allow_set_link_before_realize,
-                             OBJ_PROP_LINK_STRONG);
      s->xhci.intr_update = NULL;
      s->xhci.intr_raise = xhci_sysbus_intr_raise;
  }
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 4b60114207..012a6f3644 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3638,6 +3638,8 @@ static Property xhci_properties[] = {
      DEFINE_PROP_UINT32("p3",    XHCIState, numports_3, 4),
      DEFINE_PROP_LINK("host",    XHCIState, hostOpaque, TYPE_DEVICE,
                       DeviceState *),
+    DEFINE_PROP_LINK("dma", XHCIState, dma_mr,
+                     TYPE_MEMORY_REGION, MemoryRegion *),
      DEFINE_PROP_END_OF_LIST(),
  };

I'm slightly unsure about this one: does pulling the "dma" property into the core type cause any issues if the property is left unset for any non-sysbus xhci users?


ATB,

Mark.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]