[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/21] hw/core/register: Prefer object_initialize_child over obje
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 15/21] hw/core/register: Prefer object_initialize_child over object_initialize |
Date: |
Fri, 16 Feb 2024 12:03:06 +0100 |
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é <philmd@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
- [PATCH 10/21] hw/usb: Inline usb_new(), (continued)
- [PATCH 10/21] hw/usb: Inline usb_new(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 11/21] hw/usb: Add QOM parentship relation with hub devices, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 12/21] hw/pci-host/q35: Update q35_host_props[] comment, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 13/21] hw/pci-host/raven: Embedded OrIRQ in PRePPCIState, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 14/21] hw/pci-host/raven: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 16/21] hw/net/can/versal: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 15/21] hw/core/register: Prefer object_initialize_child over object_initialize,
Philippe Mathieu-Daudé <=
- [PATCH 17/21] hw/i386/iommu: Prefer object_initialize_child over object_initialize, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 19/21] hw/s390x/zpci-bus: Add QOM parentship relation with zPCI devices, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 18/21] hw/pci-host/versatile: Replace object_initialize() -> _child(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 20/21] hw/arm/mps2: Add QOM parentship relation with OR IRQ gates, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 21/21] hw: Add QOM parentship relation with CPUs, Philippe Mathieu-Daudé, 2024/02/16