When the QOM parent is available, prefer object_initialize_child() over object_initialize(), since it create the parent relationship.
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org> --- hw/core/register.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/register.c b/hw/core/register.c index 95b0150c0a..b6beca0e02 100644 --- a/hw/core/register.c +++ b/hw/core/register.c @@ -259,7 +259,7 @@ static RegisterInfoArray *register_init_block(DeviceState *owner, RegisterInfo *r = &ri[index]; /* Init the register, this will zero it. */ - object_initialize((void *)r, sizeof(*r), TYPE_REGISTER); + object_initialize_child(OBJECT(owner), "reg[*]", r, TYPE_REGISTER); /* Set the properties of the register */ r->data = data + data_size * index; -- 2.41.0