diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2017-01-10 14:18:01 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2017-01-11 09:19:03 +0100 |
commit | 11f547e58a08ea71a8a92d3ffe1e210b4b0b709c (patch) | |
tree | 414010646e7da8c5f883e8a6741839f0aabcc527 /hw/audio/es1370.c | |
parent | 12351a91da97b414eec8cdb09f1d9f41e535a401 (diff) |
es1370: wire up reset via DeviceClass
Instead of using qemu_register_reset().
That way we get proper cleanup for free.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Message-id: 1484054281-26139-1-git-send-email-kraxel@redhat.com
Diffstat (limited to 'hw/audio/es1370.c')
-rw-r--r-- | hw/audio/es1370.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c index 883ec69b30..fe64c1ac37 100644 --- a/hw/audio/es1370.c +++ b/hw/audio/es1370.c @@ -1010,9 +1010,9 @@ static const VMStateDescription vmstate_es1370 = { } }; -static void es1370_on_reset (void *opaque) +static void es1370_on_reset(DeviceState *dev) { - ES1370State *s = opaque; + ES1370State *s = container_of(dev, ES1370State, dev.qdev); es1370_reset (s); } @@ -1035,7 +1035,6 @@ static void es1370_realize(PCIDevice *dev, Error **errp) memory_region_init_io (&s->io, OBJECT(s), &es1370_io_ops, s, "es1370", 256); pci_register_bar (&s->dev, 0, PCI_BASE_ADDRESS_SPACE_IO, &s->io); - qemu_register_reset (es1370_on_reset, s); AUD_register_card ("es1370", &s->card); es1370_reset (s); @@ -1075,6 +1074,7 @@ static void es1370_class_init (ObjectClass *klass, void *data) set_bit(DEVICE_CATEGORY_SOUND, dc->categories); dc->desc = "ENSONIQ AudioPCI ES1370"; dc->vmsd = &vmstate_es1370; + dc->reset = es1370_on_reset; } static const TypeInfo es1370_info = { |