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:
parent
d06c2f7695
commit
61f406f377
@ -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);
|
||||
|
||||
|
||||
|
@ -25,12 +25,9 @@
|
||||
OBJECT_CHECK(TriCoreTestDeviceState, (obj), TYPE_TRICORE_TESTDEVICE)
|
||||
|
||||
typedef struct {
|
||||
/* <private> */
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
/* <public> */
|
||||
MemoryRegion iomem;
|
||||
|
||||
} TriCoreTestDeviceState;
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user