]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
hw/net: Declare link using static DEFINE_PROP_LINK() macro
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 16 Oct 2023 14:18:10 +0000 (16:18 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 19 Oct 2023 21:13:28 +0000 (23:13 +0200)
Declare link statically using DEFINE_PROP_LINK().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20231017140150.44995-7-philmd@linaro.org>

hw/net/cadence_gem.c

index f445d8bb5e7d6d88003178c34c4728817b68caa8..37e209cda692921bfa99ea41a4edfc5a4c88d6c4 100644 (file)
@@ -1654,11 +1654,6 @@ static void gem_init(Object *obj)
                           "enet", sizeof(s->regs));
 
     sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
-
-    object_property_add_link(obj, "dma", TYPE_MEMORY_REGION,
-                             (Object **)&s->dma_mr,
-                             qdev_prop_allow_set_link_before_realize,
-                             OBJ_PROP_LINK_STRONG);
 }
 
 static const VMStateDescription vmstate_cadence_gem = {
@@ -1691,6 +1686,8 @@ static Property gem_properties[] = {
                       num_type2_screeners, 4),
     DEFINE_PROP_UINT16("jumbo-max-len", CadenceGEMState,
                        jumbo_max_len, 10240),
+    DEFINE_PROP_LINK("dma", CadenceGEMState, dma_mr,
+                     TYPE_MEMORY_REGION, MemoryRegion *),
     DEFINE_PROP_END_OF_LIST(),
 };