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