[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/21] hw/tricore/testboard: Use qdev_new() instead of QOM basic
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 04/21] hw/tricore/testboard: Use qdev_new() instead of QOM basic API |
Date: |
Fri, 16 Feb 2024 12:02:55 +0100 |
Prefer QDev API for QDev objects, avoid the underlying QOM layer.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/hw/tricore/tricore_testdevice.h | 3 ---
hw/tricore/tricore_testboard.c | 4 +---
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/include/hw/tricore/tricore_testdevice.h
b/include/hw/tricore/tricore_testdevice.h
index 8b4fe15f24..2c57b62f22 100644
--- a/include/hw/tricore/tricore_testdevice.h
+++ b/include/hw/tricore/tricore_testdevice.h
@@ -25,12 +25,9 @@
OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE)
typedef struct {
- /* <private> */
SysBusDevice parent_obj;
- /* <public> */
MemoryRegion iomem;
-
} TriCoreTestDeviceState;
#endif
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index b6810e3be0..c29db8b451 100644
--- a/hw/tricore/tricore_testboard.c
+++ b/hw/tricore/tricore_testboard.c
@@ -89,9 +89,7 @@ static void tricore_testboard_init(MachineState *machine, int
board_id)
memory_region_add_subregion(sysmem, 0xf0050000, pcp_data);
memory_region_add_subregion(sysmem, 0xf0060000, pcp_text);
- test_dev = g_new(TriCoreTestDeviceState, 1);
- object_initialize(test_dev, sizeof(TriCoreTestDeviceState),
- TYPE_TRICORE_TESTDEVICE);
+ test_dev = TRICORE_TESTDEVICE(qdev_new(TYPE_TRICORE_TESTDEVICE));
memory_region_add_subregion(sysmem, 0xf0000000, &test_dev->iomem);
--
2.41.0
- [PATCH 00/21] hw: More QDev cleanups, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 01/21] hw/i386/pc: Do not use C99 mixed-declarations style, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 02/21] hw/i386/pc_sysfw: Use qdev_is_realized() instead of QOM API, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 03/21] hw/ppc/spapr_cpu: Use qdev_is_realized() instead of QOM API, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 04/21] hw/tricore/testboard: Use qdev_new() instead of QOM basic API,
Philippe Mathieu-Daudé <=
- [PATCH 05/21] hw/ppc/pnv_bmc: Use qdev_new() instead of QOM API, Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 07/21] target: Replace DEVICE(object_new) -> qdev_new(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 06/21] hw: Replace DEVICE(object_new) -> qdev_new(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 08/21] hw/isa: Inline isa_try_new(), Philippe Mathieu-Daudé, 2024/02/16
- [PATCH 09/21] hw/usb: Inline usb_try_new(), Philippe Mathieu-Daudé, 2024/02/16