From: Cédric Le Goater Date: Tue, 10 Dec 2019 13:58:45 +0000 (+0100) Subject: ppc/pnv: populate the DT with realized XSCOM devices X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9e028fffaabee37ea05baf1950376f401bbff91c;p=qemu.git ppc/pnv: populate the DT with realized XSCOM devices Some devices could be initialized in the instance_init handler but not realized for configuration reasons. Nodes should not be added in the DT for such devices. Signed-off-by: Cédric Le Goater Message-Id: <20191210135845.19773-3-clg@kaod.org> Reviewed-by: Greg Kurz Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: David Gibson --- diff --git a/hw/ppc/pnv_xscom.c b/hw/ppc/pnv_xscom.c index 760571037b..fd48d4ee37 100644 --- a/hw/ppc/pnv_xscom.c +++ b/hw/ppc/pnv_xscom.c @@ -304,7 +304,10 @@ static int xscom_dt_child(Object *child, void *opaque) PnvXScomInterface *xd = PNV_XSCOM_INTERFACE(child); PnvXScomInterfaceClass *xc = PNV_XSCOM_INTERFACE_GET_CLASS(xd); - if (xc->dt_xscom) { + /* + * Only "realized" devices should be configured in the DT + */ + if (xc->dt_xscom && DEVICE(child)->realized) { _FDT((xc->dt_xscom(xd, args->fdt, args->xscom_offset))); } }