qemu-s390x
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 16/21] hw/net/can/versal: Prefer object_initialize_child over obj


From: Philippe Mathieu-Daudé
Subject: [PATCH 16/21] hw/net/can/versal: Prefer object_initialize_child over object_initialize
Date: Fri, 16 Feb 2024 12:03:07 +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/net/can/xlnx-versal-canfd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/net/can/xlnx-versal-canfd.c b/hw/net/can/xlnx-versal-canfd.c
index 47a14cfe63..f8e4bd75e4 100644
--- a/hw/net/can/xlnx-versal-canfd.c
+++ b/hw/net/can/xlnx-versal-canfd.c
@@ -1900,7 +1900,7 @@ static int canfd_populate_regarray(XlnxVersalCANFDState 
*s,
         int index = rae[i].addr / 4;
         RegisterInfo *r = &s->reg_info[index];
 
-        object_initialize(r, sizeof(*r), TYPE_REGISTER);
+        object_initialize_child(OBJECT(s), "reg[*]", r, TYPE_REGISTER);
 
         *r = (RegisterInfo) {
             .data = &s->regs[index],
-- 
2.41.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]