Patchwork [37/39] wdt_i6300esb: use instance_finalize instead of exit

login
register
mail settings
Submitter Paolo Bonzini
Date June 4, 2013, 6:52 p.m.
Message ID <1370371954-8479-38-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/248844/
State New
Headers show

Comments

Paolo Bonzini - June 4, 2013, 6:52 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 hw/watchdog/wdt_i6300esb.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Patch

diff --git a/hw/watchdog/wdt_i6300esb.c b/hw/watchdog/wdt_i6300esb.c
index 1407fba..b8cfc64 100644
--- a/hw/watchdog/wdt_i6300esb.c
+++ b/hw/watchdog/wdt_i6300esb.c
@@ -411,8 +411,9 @@  static int i6300esb_init(PCIDevice *dev)
     return 0;
 }
 
-static void i6300esb_exit(PCIDevice *dev)
+static void i6300esb_instance_finalize(Object *obj)
 {
+    PCIDevice *dev = PCI_DEVICE(obj);
     I6300State *d = DO_UPCAST(I6300State, dev, dev);
 
     memory_region_destroy(&d->io_mem);
@@ -431,7 +432,6 @@  static void i6300esb_class_init(ObjectClass *klass, void *data)
     k->config_read = i6300esb_config_read;
     k->config_write = i6300esb_config_write;
     k->init = i6300esb_init;
-    k->exit = i6300esb_exit;
     k->vendor_id = PCI_VENDOR_ID_INTEL;
     k->device_id = PCI_DEVICE_ID_INTEL_ESB_9;
     k->class_id = PCI_CLASS_SYSTEM_OTHER;
@@ -444,6 +444,7 @@  static const TypeInfo i6300esb_info = {
     .parent        = TYPE_PCI_DEVICE,
     .instance_size = sizeof(I6300State),
     .class_init    = i6300esb_class_init,
+    .instance_finalize = i6300esb_instance_finalize,
 };
 
 static void i6300esb_register_types(void)