From patchwork Tue Sep 3 12:33:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 272220 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id B9BC62C008F for ; Tue, 3 Sep 2013 22:39:33 +1000 (EST) Received: from localhost ([::1]:45519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGptL-0004kG-C5 for incoming@patchwork.ozlabs.org; Tue, 03 Sep 2013 08:39:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGpoK-0006uO-4n for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGpoA-0006TF-Sh for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:19 -0400 Received: from mail-ee0-x22f.google.com ([2a00:1450:4013:c00::22f]:56707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGpoA-0006St-F3 for qemu-devel@nongnu.org; Tue, 03 Sep 2013 08:34:10 -0400 Received: by mail-ee0-f47.google.com with SMTP id d49so2983169eek.34 for ; Tue, 03 Sep 2013 05:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=5iA3JyOxuJKB+Z4QJAQ5VYBdZMSTEarDqTf8uetMfHI=; b=TgmHroVwzPzaMeUI/Bi7MfiaVuSB353mvhmSJUxaeQl1M2tuSNl0COhHliAnjn1lzM mYrsWHGA2xrPrV8SL0kSMdaCI357myx/Z/ouIaYvfGbyA5RFyFq0gxdVyZp3QCKOuEPp 5EPfDdVMS/FRCM7u0capYab/3je9JVKOjleNo9WD+3juHH239ZdaGWTQ5D8aRiB85mee gTs/ztNiBhcyhA9vYBtQy5/NllU9Qwe0rDyQByaYpTv/n1qtb8hpTbYb4Rnl5MPpw44+ Pn77N6IPEw+yBu9r+/5fNDlU3E2WiPC4/BwQPUyrN9I6P5aWRbYKTcK1cmT4K5kmBOtv DUXA== X-Received: by 10.14.218.197 with SMTP id k45mr46253338eep.32.1378211649633; Tue, 03 Sep 2013 05:34:09 -0700 (PDT) Received: from playground.lan (net-37-117-144-28.cust.dsl.vodafone.it. [37.117.144.28]) by mx.google.com with ESMTPSA id f49sm31150419eec.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 03 Sep 2013 05:34:08 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 3 Sep 2013 14:33:09 +0200 Message-Id: <1378211609-16121-19-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> References: <1378211609-16121-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22f Cc: mst@redhat.com Subject: [Qemu-devel] [PATCH 18/38] eepro100: use instance_finalize instead of exit X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 ffa60d5..9d45aa4 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); @@ -2090,7 +2091,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; @@ -2108,6 +2108,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); }