From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjwMI-0007qI-3B for qemu-devel@nongnu.org; Tue, 04 Jun 2013 14:53:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UjwMH-0007gp-9v for qemu-devel@nongnu.org; Tue, 04 Jun 2013 14:53:26 -0400 Received: from mail-wg0-x229.google.com ([2a00:1450:400c:c00::229]:46779) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UjwMG-0007gS-VG for qemu-devel@nongnu.org; Tue, 04 Jun 2013 14:53:25 -0400 Received: by mail-wg0-f41.google.com with SMTP id k13so4165027wgh.0 for ; Tue, 04 Jun 2013 11:53:24 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Tue, 4 Jun 2013 20:52:14 +0200 Message-Id: <1370371954-8479-20-git-send-email-pbonzini@redhat.com> In-Reply-To: <1370371954-8479-1-git-send-email-pbonzini@redhat.com> References: <1370371954-8479-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 19/39] eepro100: use instance_finalize instead of exit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mst@redhat.com Signed-off-by: Paolo Bonzini --- hw/net/eepro100.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c index dc99ea6..5f95240 100644 --- a/hw/net/eepro100.c +++ b/hw/net/eepro100.c @@ -1840,8 +1840,9 @@ static void nic_cleanup(NetClientState *nc) s->nic = NULL; } -static void pci_nic_uninit(PCIDevice *pci_dev) +static void pci_nic_instance_finalize(Object *obj) { + PCIDevice *pci_dev = PCI_DEVICE(obj); EEPRO100State *s = DO_UPCAST(EEPRO100State, dev, pci_dev); memory_region_destroy(&s->mmio_bar); @@ -2089,7 +2090,6 @@ static void eepro100_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_NETWORK_ETHERNET; k->romfile = "pxe-eepro100.rom"; k->init = e100_nic_init; - k->exit = pci_nic_uninit; k->device_id = info->device_id; k->revision = info->revision; k->subsystem_vendor_id = info->subsystem_vendor_id; @@ -2107,6 +2107,7 @@ static void eepro100_register_types(void) type_info.parent = TYPE_PCI_DEVICE; type_info.class_init = eepro100_class_init; type_info.instance_size = sizeof(EEPRO100State); + type_info.instance_finalize = pci_nic_instance_finalize; type_register(&type_info); } -- 1.8.1.4