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>
This commit is contained in:
Philippe Mathieu-Daudé 2024-02-14 17:44:28 +01:00
parent d06c2f7695
commit 61f406f377
2 changed files with 1 additions and 6 deletions

View File

@ -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);

View File

@ -25,12 +25,9 @@
OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE)
typedef struct {
/* <private> */
SysBusDevice parent_obj;
/* <public> */
MemoryRegion iomem;
} TriCoreTestDeviceState;
#endif