From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Li Qiang <liq3ea@gmail.com>, jan.kiszka@web.de, peter.maydell@linaro.org
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
maozhongyi@cmss.chinamobile.com,
Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] hw: arm: musicpal: drop TYPE_WM8750 in object_property_set_link()
Date: Thu, 22 Nov 2018 11:35:13 +0100 [thread overview]
Message-ID: <e61b7517-a736-8cb5-ce35-815225f18c52@redhat.com> (raw)
In-Reply-To: <1542880825-2604-1-git-send-email-liq3ea@gmail.com>
Hi Li,
On 22/11/18 11:00, Li Qiang wrote:
> The third argument of object_property_set_link() is the name of
> property, not related with the QOM type name, using the constant
> string instead.
You are correct.
>
> Signed-off-by: Li Qiang <liq3ea@gmail.com>
> ---
> hw/arm/musicpal.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c
> index 9648b3af44..726ae29394 100644
> --- a/hw/arm/musicpal.c
> +++ b/hw/arm/musicpal.c
> @@ -1696,7 +1696,7 @@ static void musicpal_init(MachineState *machine)
> dev = qdev_create(NULL, TYPE_MV88W8618_AUDIO);
> s = SYS_BUS_DEVICE(dev);
> object_property_set_link(OBJECT(dev), OBJECT(wm8750_dev),
> - TYPE_WM8750, NULL);
> + "wm8750", NULL);
Since this property is not related to migration, maybe we can resolve
this the other way, using TYPE_WM8750 in mv88w8618_audio_init():
-- >8 --
@@ -255,3 +255,3 @@ static void mv88w8618_audio_init(Object *obj)
- object_property_add_link(OBJECT(dev), "wm8750", TYPE_WM8750,
+ object_property_add_link(OBJECT(dev), TYPE_WM8750, TYPE_WM8750,
(Object **) &s->wm,
---
So using the same definition would protect someone to accidentaly rename
the property name.
What do you think?
Regards,
Phil.
> qdev_init_nofail(dev);
> sysbus_mmio_map(s, 0, MP_AUDIO_BASE);
> sysbus_connect_irq(s, 0, pic[MP_AUDIO_IRQ]);
>
next prev parent reply other threads:[~2018-11-22 10:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 10:00 [Qemu-devel] [PATCH] hw: arm: musicpal: drop TYPE_WM8750 in object_property_set_link() Li Qiang
2018-11-22 10:35 ` Philippe Mathieu-Daudé [this message]
2018-11-22 10:38 ` Peter Maydell
2018-11-22 10:40 ` Li Qiang
2018-11-22 11:03 ` Philippe Mathieu-Daudé
2018-11-30 12:11 ` Peter Maydell
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=e61b7517-a736-8cb5-ce35-815225f18c52@redhat.com \
--to=philmd@redhat.com \
--cc=armbru@redhat.com \
--cc=jan.kiszka@web.de \
--cc=liq3ea@gmail.com \
--cc=maozhongyi@cmss.chinamobile.com \
--cc=peter.maydell@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).