From: Peter Maydell <peter.maydell@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>
Cc: qemu-devel@nongnu.org,
Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
Markus Armbruster <armbru@redhat.com>,
Gustavo Romero <gustavo.romero@linaro.org>,
qemu-arm@nongnu.org
Subject: Re: [PATCH 3/4] hw/arm/stellaris: Add missing QOM 'machine' parent
Date: Thu, 1 Feb 2024 16:28:16 +0000 [thread overview]
Message-ID: <CAFEAcA-w+=dy3_oiz63eg2AcS-vu93ZFrV1ZKF7iTC3eSYRHTQ@mail.gmail.com> (raw)
In-Reply-To: <20240130190317.25692-4-philmd@linaro.org>
On Tue, 30 Jan 2024 at 19:03, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> QDev objects created with qdev_new() need to manually add
> their parent relationship with object_property_add_child().
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
> hw/arm/stellaris.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/arm/stellaris.c b/hw/arm/stellaris.c
> index 284b95005f..bb88b3ebde 100644
> --- a/hw/arm/stellaris.c
> +++ b/hw/arm/stellaris.c
> @@ -1247,10 +1247,13 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
> &error_fatal);
>
> ssddev = qdev_new("ssd0323");
> + object_property_add_child(OBJECT(ms), "oled", OBJECT(ssddev));
> qdev_prop_set_uint8(ssddev, "cs", 1);
> qdev_realize_and_unref(ssddev, bus, &error_fatal);
>
> gpio_d_splitter = qdev_new(TYPE_SPLIT_IRQ);
> + object_property_add_child(OBJECT(ms), "splitter",
> + OBJECT(gpio_d_splitter));
> qdev_prop_set_uint32(gpio_d_splitter, "num-lines", 2);
> qdev_realize_and_unref(gpio_d_splitter, NULL, &error_fatal);
> qdev_connect_gpio_out(
> @@ -1287,6 +1290,7 @@ static void stellaris_init(MachineState *ms, stellaris_board_info *board)
> DeviceState *gpad;
>
> gpad = qdev_new(TYPE_STELLARIS_GAMEPAD);
> + object_property_add_child(OBJECT(ms), "gamepad", OBJECT(gpad));
> for (i = 0; i < ARRAY_SIZE(gpad_keycode); i++) {
> qlist_append_int(gpad_keycode_list, gpad_keycode[i]);
> }
> --
We create almost all the devices in this board with
qdev_new(), and we don't use object_property_add_child()
on any of them. What is it about these three devices in
particular that means we need to call that function?
thanks
-- PMM
next prev parent reply other threads:[~2024-02-01 16:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-30 19:03 [PATCH 0/4] hw/arm/stellaris: QOM/QDev cleanups Philippe Mathieu-Daudé
2024-01-30 19:03 ` [PATCH 1/4] hw/arm/stellaris: Convert ADC controller to Resettable interface Philippe Mathieu-Daudé
2024-02-01 16:18 ` Peter Maydell
2024-01-30 19:03 ` [PATCH 2/4] hw/arm/stellaris: Convert I2C " Philippe Mathieu-Daudé
2024-02-01 16:24 ` Peter Maydell
2024-02-13 15:50 ` Philippe Mathieu-Daudé
2024-01-30 19:03 ` [PATCH 3/4] hw/arm/stellaris: Add missing QOM 'machine' parent Philippe Mathieu-Daudé
2024-02-01 16:28 ` Peter Maydell [this message]
2024-02-13 15:40 ` Philippe Mathieu-Daudé
2024-02-01 16:47 ` Peter Maydell
2024-01-30 19:03 ` [PATCH 4/4] hw/arm/stellaris: Add missing QOM 'SoC' parent Philippe Mathieu-Daudé
2024-02-01 16:46 ` Peter Maydell
2024-02-13 15:36 ` Philippe Mathieu-Daudé
2024-02-14 7:08 ` Cédric Le Goater
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='CAFEAcA-w+=dy3_oiz63eg2AcS-vu93ZFrV1ZKF7iTC3eSYRHTQ@mail.gmail.com' \
--to=peter.maydell@linaro.org \
--cc=armbru@redhat.com \
--cc=gustavo.romero@linaro.org \
--cc=manos.pitsidianakis@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@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).