mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
pci: move unregister from PCIDevice to PCIDeviceInfo
One more cleanup while being at it ;) Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
a36a344dcd
commit
e3936fa574
8 changed files with 13 additions and 11 deletions
7
hw/pci.c
7
hw/pci.c
|
|
@ -26,6 +26,7 @@
|
|||
#include "monitor.h"
|
||||
#include "net.h"
|
||||
#include "sysemu.h"
|
||||
#include "msix.h"
|
||||
|
||||
//#define DEBUG_PCI
|
||||
#ifdef DEBUG_PCI
|
||||
|
|
@ -402,13 +403,15 @@ static void pci_unregister_io_regions(PCIDevice *pci_dev)
|
|||
static int pci_unregister_device(DeviceState *dev)
|
||||
{
|
||||
PCIDevice *pci_dev = DO_UPCAST(PCIDevice, qdev, dev);
|
||||
PCIDeviceInfo *info = DO_UPCAST(PCIDeviceInfo, qdev, dev->info);
|
||||
int ret = 0;
|
||||
|
||||
if (pci_dev->unregister)
|
||||
ret = pci_dev->unregister(pci_dev);
|
||||
if (info->exit)
|
||||
ret = info->exit(pci_dev);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
msix_uninit(pci_dev);
|
||||
pci_unregister_io_regions(pci_dev);
|
||||
|
||||
qemu_free_irqs(pci_dev->irq);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue