From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
armbru@redhat.com, david@gibson.dropbear.id.au,
atar4qemu@gmail.com, qemu-devel@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [PATCH 3/6] sparc32-espdma: use object_initialize_child() for esp child object
Date: Sun, 20 Sep 2020 12:49:33 +0200 [thread overview]
Message-ID: <cb9850a7-83fb-edc1-e2bb-856986d6acdf@amsat.org> (raw)
In-Reply-To: <20200920082018.16135-4-mark.cave-ayland@ilande.co.uk>
On 9/20/20 10:20 AM, Mark Cave-Ayland wrote:
> Store the child object directly within the sparc32-espdma object rather than
> using link properties.
>
> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
> hw/dma/sparc32_dma.c | 17 ++++++++---------
> include/hw/sparc/sparc32_dma.h | 2 +-
> 2 files changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/hw/dma/sparc32_dma.c b/hw/dma/sparc32_dma.c
> index 84196afb95..2cbe331959 100644
> --- a/hw/dma/sparc32_dma.c
> +++ b/hw/dma/sparc32_dma.c
> @@ -290,27 +290,26 @@ static const TypeInfo sparc32_dma_device_info = {
> static void sparc32_espdma_device_init(Object *obj)
> {
> DMADeviceState *s = SPARC32_DMA_DEVICE(obj);
> + ESPDMADeviceState *es = SPARC32_ESPDMA_DEVICE(obj);
>
> memory_region_init_io(&s->iomem, OBJECT(s), &dma_mem_ops, s,
> "espdma-mmio", DMA_SIZE);
> +
> + object_initialize_child(obj, "esp", &es->esp, TYPE_ESP);
> }
>
> static void sparc32_espdma_device_realize(DeviceState *dev, Error **errp)
> {
> - DeviceState *d;
> - SysBusESPState *sysbus;
> - ESPState *esp;
> -
> - d = qdev_new(TYPE_ESP);
> - object_property_add_child(OBJECT(dev), "esp", OBJECT(d));
> - sysbus = ESP(d);
> - esp = &sysbus->esp;
> + ESPDMADeviceState *es = SPARC32_ESPDMA_DEVICE(dev);
> + SysBusESPState *sysbus = ESP(&es->esp);
> + ESPState *esp = &sysbus->esp;
> +
> esp->dma_memory_read = espdma_memory_read;
> esp->dma_memory_write = espdma_memory_write;
> esp->dma_opaque = SPARC32_DMA_DEVICE(dev);
> sysbus->it_shift = 2;
> esp->dma_enabled = 1;
> - sysbus_realize_and_unref(SYS_BUS_DEVICE(d), &error_fatal);
> + sysbus_realize(SYS_BUS_DEVICE(sysbus), &error_fatal);
> }
>
> static void sparc32_espdma_device_class_init(ObjectClass *klass, void *data)
> diff --git a/include/hw/sparc/sparc32_dma.h b/include/hw/sparc/sparc32_dma.h
> index f2bfe272ba..d40eca0cc8 100644
> --- a/include/hw/sparc/sparc32_dma.h
> +++ b/include/hw/sparc/sparc32_dma.h
> @@ -32,7 +32,7 @@ DECLARE_INSTANCE_CHECKER(ESPDMADeviceState, SPARC32_ESPDMA_DEVICE,
> struct ESPDMADeviceState {
> DMADeviceState parent_obj;
>
> - SysBusESPState *esp;
> + SysBusESPState esp;
> };
>
> #define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma"
>
next prev parent reply other threads:[~2020-09-20 10:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-20 8:20 [PATCH 0/6] QOM minor fixes Mark Cave-Ayland
2020-09-20 8:20 ` [PATCH 1/6] sparc32-dma: use object_initialize_child() for espdma and ledma child objects Mark Cave-Ayland
2020-09-20 10:49 ` Philippe Mathieu-Daudé
2020-09-20 8:20 ` [PATCH 2/6] sparc32-ledma: use object_initialize_child() for lance child object Mark Cave-Ayland
2020-09-20 10:49 ` Philippe Mathieu-Daudé
2020-09-20 8:20 ` [PATCH 3/6] sparc32-espdma: use object_initialize_child() for esp " Mark Cave-Ayland
2020-09-20 10:49 ` Philippe Mathieu-Daudé [this message]
2020-09-20 8:20 ` [PATCH 4/6] sparc32-ledma: don't reference nd_table directly within the device Mark Cave-Ayland
2020-09-21 9:25 ` Markus Armbruster
2020-09-21 17:03 ` Mark Cave-Ayland
2020-09-21 17:14 ` Mark Cave-Ayland
2020-09-26 10:23 ` Mark Cave-Ayland
2020-09-21 9:57 ` Philippe Mathieu-Daudé
2020-09-21 17:08 ` Mark Cave-Ayland
2020-09-21 17:58 ` Philippe Mathieu-Daudé
2020-09-26 10:29 ` Mark Cave-Ayland
2020-09-20 8:20 ` [PATCH 5/6] macio: don't reference serial_hd() " Mark Cave-Ayland
2020-09-20 10:52 ` BALATON Zoltan via
2020-09-20 17:59 ` Mark Cave-Ayland
2020-09-20 8:20 ` [PATCH 6/6] sabre: don't call sysbus_mmio_map() in sabre_realize() Mark Cave-Ayland
2020-09-20 10:48 ` Philippe Mathieu-Daudé
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=cb9850a7-83fb-edc1-e2bb-856986d6acdf@amsat.org \
--to=f4bug@amsat.org \
--cc=armbru@redhat.com \
--cc=atar4qemu@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).