summary refs log tree commit diff stats
path: root/include/hw/ppc
diff options
context:
space:
mode:
authorGreg Kurz <groug@kaod.org>2020-12-01 12:37:28 +0100
committerDavid Gibson <david@gibson.dropbear.id.au>2020-12-14 15:54:12 +1100
commitbc370a659a33865f8b55332f6363c45896bae56d (patch)
tree9295a8e9da990222c4e7ac32782d2b7f31461328 /include/hw/ppc
parentf9b43958b99ea0cc65d0857e073bda381372242c (diff)
downloadfocaccia-qemu-bc370a659a33865f8b55332f6363c45896bae56d.tar.gz
focaccia-qemu-bc370a659a33865f8b55332f6363c45896bae56d.zip
spapr: spapr_drc_attach() cannot fail
All users are passing &error_abort already. Document the fact
that spapr_drc_attach() should only be passed a free DRC, which
is supposedly the case if appropriate checking is done earlier.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20201201113728.885700-5-groug@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'include/hw/ppc')
-rw-r--r--include/hw/ppc/spapr_drc.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h
index 165b281496..def3593adc 100644
--- a/include/hw/ppc/spapr_drc.h
+++ b/include/hw/ppc/spapr_drc.h
@@ -235,7 +235,13 @@ SpaprDrc *spapr_drc_by_index(uint32_t index);
 SpaprDrc *spapr_drc_by_id(const char *type, uint32_t id);
 int spapr_dt_drc(void *fdt, int offset, Object *owner, uint32_t drc_type_mask);
 
-bool spapr_drc_attach(SpaprDrc *drc, DeviceState *d, Error **errp);
+/*
+ * These functions respectively abort if called with a device already
+ * attached or no device attached. In the case of spapr_drc_attach(),
+ * this means that the attachability of the DRC *must* be checked
+ * beforehand (eg. check drc->dev at pre-plug).
+ */
+void spapr_drc_attach(SpaprDrc *drc, DeviceState *d);
 void spapr_drc_detach(SpaprDrc *drc);
 
 /* Returns true if a hot plug/unplug request is pending */