On 21/09/2020 18:58, Philippe Mathieu-Daudé wrote: > Sorry I guess I got confused by the 2 different sparc32_dma_init() > functions. > > Since ledma always expose lance, maybe you can use: > > diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c > index 2cbe331959a..9a907a30373 100644 > --- a/hw/dma/sparc32_dma.c > +++ b/hw/dma/sparc32_dma.c > @@ -336,18 +336,14 @@ static void sparc32_ledma_device_init(Object *obj) > "ledma-mmio", DMA_SIZE); > > object_initialize_child(obj, "lance", &ls->lance, TYPE_LANCE); > + qdev_alias_all_properties(DEVICE(&ls->lance), obj); > } > > This way you set the properties directly on the ledma and only > have to sysbus_map lance.
Thanks for the hint. I've had a look at qdev_alias_all_properties() and for the moment I'd prefer to get the reference to the internal lance/esp devices via object_resolve_path_component(), since to me it makes it clearer on which device the properties really belong from just looking at the code. ATB, Mark.