[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH v2 2/5] ppc/xics: move the instance_init handler under
From: |
Cédric Le Goater |
Subject: |
[Qemu-ppc] [PATCH v2 2/5] ppc/xics: move the instance_init handler under the ics-base class |
Date: |
Mon, 25 Jun 2018 11:17:15 +0200 |
Signed-off-by: Cédric Le Goater <address@hidden>
---
hw/intc/xics.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/intc/xics.c b/hw/intc/xics.c
index d6066d561fdc..83340770f7c0 100644
--- a/hw/intc/xics.c
+++ b/hw/intc/xics.c
@@ -611,13 +611,6 @@ static const VMStateDescription vmstate_ics_simple = {
},
};
-static void ics_simple_initfn(Object *obj)
-{
- ICSState *ics = ICS_SIMPLE(obj);
-
- ics->offset = XICS_IRQ_BASE;
-}
-
static void ics_simple_realize(DeviceState *dev, Error **errp)
{
ICSState *ics = ICS_SIMPLE(dev);
@@ -655,7 +648,6 @@ static const TypeInfo ics_simple_info = {
.instance_size = sizeof(ICSState),
.class_init = ics_simple_class_init,
.class_size = sizeof(ICSStateClass),
- .instance_init = ics_simple_initfn,
};
static void ics_base_realize(DeviceState *dev, Error **errp)
@@ -679,6 +671,13 @@ static void ics_base_realize(DeviceState *dev, Error
**errp)
ics->irqs = g_malloc0(ics->nr_irqs * sizeof(ICSIRQState));
}
+static void ics_base_instance_init(Object *obj)
+{
+ ICSState *ics = ICS_BASE(obj);
+
+ ics->offset = XICS_IRQ_BASE;
+}
+
static Property ics_base_properties[] = {
DEFINE_PROP_UINT32("nr-irqs", ICSState, nr_irqs, 0),
DEFINE_PROP_END_OF_LIST(),
@@ -697,6 +696,7 @@ static const TypeInfo ics_base_info = {
.parent = TYPE_DEVICE,
.abstract = true,
.instance_size = sizeof(ICSState),
+ .instance_init = ics_base_instance_init,
.class_init = ics_base_class_init,
.class_size = sizeof(ICSStateClass),
};
--
2.13.6
- [Qemu-ppc] [PATCH v2 0/5] rework the ICS classes inheritance tree, Cédric Le Goater, 2018/06/25
- [Qemu-ppc] [PATCH v2 1/5] ppc/xics: introduce a parent_realize in ICSStateClass, Cédric Le Goater, 2018/06/25
- [Qemu-ppc] [PATCH v2 2/5] ppc/xics: move the instance_init handler under the ics-base class,
Cédric Le Goater <=
- [Qemu-ppc] [PATCH v2 3/5] ppx/xics: introduce a parent_reset in ICSStateClass, Cédric Le Goater, 2018/06/25
- [Qemu-ppc] [PATCH v2 4/5] ppc/xics: move the vmstate structures under the ics-base class, Cédric Le Goater, 2018/06/25
- [Qemu-ppc] [PATCH v2 5/5] ppc/xics: rework the ICS classes inheritance tree, Cédric Le Goater, 2018/06/25
- Re: [Qemu-ppc] [PATCH v2 0/5] rework the ICS classes inheritance tree, Greg Kurz, 2018/06/26