aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/pnv_psi.c
diff options
context:
space:
mode:
authorCédric Le Goater <clg@kaod.org>2020-01-06 15:56:34 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2020-01-08 11:01:59 +1100
commit34bdca8faebf59dff71bc6eae89f54926362b45e (patch)
treeb88900a2ad94a33800f601744ab9fa770d70df03 /hw/ppc/pnv_psi.c
parentbaa45b17101c5375be031edb863e94a79c75b86c (diff)
ppc/pnv: Introduce a "xics" property alias under the PSI model
This removes the need of the intermediate link under PSI to pass the XICS link to the underlying ICSState object. Signed-off-by: Cédric Le Goater <clg@kaod.org> Reviewed-by: Greg Kurz <groug@kaod.org> Message-Id: <20200106145645.4539-2-clg@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc/pnv_psi.c')
-rw-r--r--hw/ppc/pnv_psi.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/hw/ppc/pnv_psi.c b/hw/ppc/pnv_psi.c
index 75e20d9da0..4da3d25686 100644
--- a/hw/ppc/pnv_psi.c
+++ b/hw/ppc/pnv_psi.c
@@ -470,6 +470,8 @@ static void pnv_psi_power8_instance_init(Object *obj)
object_initialize_child(obj, "ics-psi", &psi8->ics, sizeof(psi8->ics),
TYPE_ICS, &error_abort, NULL);
+ object_property_add_alias(obj, ICS_PROP_XICS, OBJECT(&psi8->ics),
+ ICS_PROP_XICS, &error_abort);
}
static const uint8_t irq_to_xivr[] = {
@@ -485,19 +487,10 @@ static void pnv_psi_power8_realize(DeviceState *dev, Error **errp)
{
PnvPsi *psi = PNV_PSI(dev);
ICSState *ics = &PNV8_PSI(psi)->ics;
- Object *obj;
Error *err = NULL;
unsigned int i;
- obj = object_property_get_link(OBJECT(dev), "xics", &err);
- if (!obj) {
- error_setg(errp, "%s: required link 'xics' not found: %s",
- __func__, error_get_pretty(err));
- return;
- }
-
/* Create PSI interrupt control source */
- object_property_set_link(OBJECT(ics), obj, ICS_PROP_XICS, &error_abort);
object_property_set_int(OBJECT(ics), PSI_NUM_INTERRUPTS, "nr-irqs", &err);
if (err) {
error_propagate(errp, err);