From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PULL 5/5] es1370: wire up reset via DeviceClass
Date: Wed, 11 Jan 2017 10:33:47 +0100 [thread overview]
Message-ID: <1484127227-26496-6-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1484127227-26496-1-git-send-email-kraxel@redhat.com>
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
---
hw/audio/es1370.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hw/audio/es1370.c b/hw/audio/es1370.c
index 883ec69..fe64c1a 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 = {
--
1.8.3.1
next prev parent reply other threads:[~2017-01-11 9:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-11 9:33 [Qemu-devel] [PULL 0/5] audio patch queue Gerd Hoffmann
2017-01-11 9:33 ` [Qemu-devel] [PULL 1/5] hw/audio: QOM'ify marvell_88w8618.c Gerd Hoffmann
2017-01-11 9:33 ` [Qemu-devel] [PULL 2/5] hw/audio: QOM'ify pl041.c Gerd Hoffmann
2017-01-11 9:33 ` [Qemu-devel] [PULL 3/5] audio: es1370: add exit function Gerd Hoffmann
2017-01-11 9:33 ` [Qemu-devel] [PULL 4/5] audio: ac97: " Gerd Hoffmann
2017-01-11 9:33 ` Gerd Hoffmann [this message]
2017-01-12 17:51 ` [Qemu-devel] [PULL 0/5] audio patch queue Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1484127227-26496-6-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).