mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 00:03:54 -06:00
spapr: Refactor spapr_drc_detach()
This function has two unused parameters - remove them. It also sets awaiting_release on all paths, except one. On that path setting it is harmless, since it will be immediately cleared by spapr_drc_release(). So factor it out of the if statements. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Greg Kurz <groug@kaod.org> Tested-by: Daniel Barboza <danielhb@linux.vnet.ibm.com>
This commit is contained in:
parent
ba50822ff8
commit
a8dc47fd82
4 changed files with 11 additions and 21 deletions
|
@ -1478,7 +1478,6 @@ static void spapr_pci_unplug_request(HotplugHandler *plug_handler,
|
|||
PCIDevice *pdev = PCI_DEVICE(plugged_dev);
|
||||
sPAPRDRConnectorClass *drck;
|
||||
sPAPRDRConnector *drc = spapr_phb_get_pci_drc(phb, pdev);
|
||||
Error *local_err = NULL;
|
||||
|
||||
if (!phb->dr_enabled) {
|
||||
error_setg(errp, QERR_BUS_NO_HOTPLUG,
|
||||
|
@ -1516,11 +1515,7 @@ static void spapr_pci_unplug_request(HotplugHandler *plug_handler,
|
|||
}
|
||||
}
|
||||
|
||||
spapr_drc_detach(drc, DEVICE(pdev), &local_err);
|
||||
if (local_err) {
|
||||
error_propagate(errp, local_err);
|
||||
return;
|
||||
}
|
||||
spapr_drc_detach(drc);
|
||||
|
||||
/* if this isn't func 0, defer unplug event. otherwise signal removal
|
||||
* for all present functions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue