aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@linaro.org>2024-02-14 17:44:28 +0100
committerPhilippe Mathieu-Daudé <philmd@linaro.org>2024-02-22 12:47:40 +0100
commit61f406f37726833650d8c4441a4c1baf1f5b54db (patch)
tree3255d49b50e9cda098c19a0c6d35e3e846e6f76e
parentd06c2f769559d2211fa1662318182a236293e920 (diff)
downloadqemu-61f406f37726833650d8c4441a4c1baf1f5b54db.zip
qemu-61f406f37726833650d8c4441a4c1baf1f5b54db.tar.gz
qemu-61f406f37726833650d8c4441a4c1baf1f5b54db.tar.bz2
hw/tricore/testboard: Use qdev_new() instead of QOM basic API
Prefer QDev API for QDev objects, avoid the underlying QOM layer. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Message-Id: <20240216110313.17039-5-philmd@linaro.org>
-rw-r--r--hw/tricore/tricore_testboard.c4
-rw-r--r--include/hw/tricore/tricore_testdevice.h3
2 files changed, 1 insertions, 6 deletions
diff --git a/hw/tricore/tricore_testboard.c b/hw/tricore/tricore_testboard.c
index b6810e3..c29db8b 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);
diff --git a/include/hw/tricore/tricore_testdevice.h b/include/hw/tricore/tricore_testdevice.h
index 8b4fe15..2c57b62 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