[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH] hw: arm: musicpal: drop TYPE_WM8750 in object_pro
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-arm] [PATCH] hw: arm: musicpal: drop TYPE_WM8750 in object_property_set_link() |
Date: |
Thu, 22 Nov 2018 11:35:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 |
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 <address@hidden>
> ---
> 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]);
>