@@ -318,6 +318,13 @@ static void loongson_ipi_realize(DeviceState *dev, Error **errp)
}
}
+static void loongson_ipi_unrealize(DeviceState *dev)
+{
+ LoongsonIPI *s = LOONGSON_IPI(dev);
+
+ g_free(s->cpu);
+}
+
static const VMStateDescription vmstate_ipi_core = {
.name = "ipi-single",
.version_id = 2,
@@ -353,23 +360,16 @@ static void loongson_ipi_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
dc->realize = loongson_ipi_realize;
+ dc->unrealize = loongson_ipi_unrealize;
device_class_set_props(dc, ipi_properties);
dc->vmsd = &vmstate_loongson_ipi;
}
-static void loongson_ipi_finalize(Object *obj)
-{
- LoongsonIPI *s = LOONGSON_IPI(obj);
-
- g_free(s->cpu);
-}
-
static const TypeInfo loongson_ipi_info = {
.name = TYPE_LOONGSON_IPI,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_size = sizeof(LoongsonIPI),
.class_init = loongson_ipi_class_init,
- .instance_finalize = loongson_ipi_finalize,
};
static void loongson_ipi_register_types(void)