Signed-off-by: Paolo Bonzini <pbonz...@redhat.com> --- hw/net/rtl8139.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 7993f9f..c1c4921 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -3437,8 +3437,9 @@ static void rtl8139_cleanup(NetClientState *nc) s->nic = NULL; } -static void pci_rtl8139_uninit(PCIDevice *dev) +static void pci_rtl8139_instance_finalize(Object *obj) { + PCIDevice *dev = PCI_DEVICE(obj); RTL8139State *s = DO_UPCAST(RTL8139State, dev, dev); memory_region_destroy(&s->bar_io); @@ -3532,7 +3533,6 @@ static void rtl8139_class_init(ObjectClass *klass, void *data) PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); k->init = pci_rtl8139_init; - k->exit = pci_rtl8139_uninit; k->romfile = "efi-rtl8139.rom"; k->vendor_id = PCI_VENDOR_ID_REALTEK; k->device_id = PCI_DEVICE_ID_REALTEK_8139; @@ -3548,6 +3548,7 @@ static const TypeInfo rtl8139_info = { .parent = TYPE_PCI_DEVICE, .instance_size = sizeof(RTL8139State), .class_init = rtl8139_class_init, + .instance_finalize = pci_rtl8139_instance_finalize, }; static void rtl8139_register_types(void) -- 1.8.1.4