aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc/spapr_pci.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2017-06-06 17:44:11 +1000
committerDavid Gibson <david@gibson.dropbear.id.au>2017-06-08 14:38:26 +1000
commit0be4e88621df69f044e043f0f16d4017d35f30ae (patch)
tree4a007971cdab76c91a4795dbd40168e154a52186 /hw/ppc/spapr_pci.c
parentcd74d27e42f25e574195b0d3046acb33fd65b078 (diff)
spapr: Change DRC attach & detach methods to functions
DRC objects have attach & detach methods, but there's only one implementation. Although there are some differences in its behaviour for different DRC types, the overall structure is the same, so while we might want different method implementations for some parts, we're unlikely to want them for the top-level functions. So, replace them with direct function calls. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'hw/ppc/spapr_pci.c')
-rw-r--r--hw/ppc/spapr_pci.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c
index 5cba8f96dd..56cb4b8537 100644
--- a/hw/ppc/spapr_pci.c
+++ b/hw/ppc/spapr_pci.c
@@ -1349,7 +1349,6 @@ static void spapr_phb_add_pci_device(sPAPRDRConnector *drc,
PCIDevice *pdev,
Error **errp)
{
- sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
DeviceState *dev = DEVICE(pdev);
void *fdt = NULL;
int fdt_start_offset = 0, fdt_size;
@@ -1361,8 +1360,8 @@ static void spapr_phb_add_pci_device(sPAPRDRConnector *drc,
goto out;
}
- drck->attach(drc, DEVICE(pdev),
- fdt, fdt_start_offset, !dev->hotplugged, errp);
+ spapr_drc_attach(drc, DEVICE(pdev),
+ fdt, fdt_start_offset, !dev->hotplugged, errp);
out:
if (*errp) {
g_free(fdt);
@@ -1391,9 +1390,7 @@ static void spapr_phb_remove_pci_device(sPAPRDRConnector *drc,
PCIDevice *pdev,
Error **errp)
{
- sPAPRDRConnectorClass *drck = SPAPR_DR_CONNECTOR_GET_CLASS(drc);
-
- drck->detach(drc, DEVICE(pdev), errp);
+ spapr_drc_detach(drc, DEVICE(pdev), errp);
}
static sPAPRDRConnector *spapr_phb_get_pci_func_drc(sPAPRPHBState *phb,