From: malc <av1474@comtv.ru>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] Re: [PATCH 2/4] hda-audio: exit cleanup
Date: Mon, 8 Nov 2010 20:50:41 +0300 (MSK) [thread overview]
Message-ID: <alpine.LNX.2.00.1011082050240.1505@linmac> (raw)
In-Reply-To: <1289223970-31221-3-git-send-email-kraxel@redhat.com>
On Mon, 8 Nov 2010, Gerd Hoffmann wrote:
> Add exit callback to the driver. Unregister the sound card properly
> on exit.
>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
> hw/hda-audio.c | 23 +++++++++++++++++++++++
> 1 files changed, 23 insertions(+), 0 deletions(-)
>
> diff --git a/hw/hda-audio.c b/hw/hda-audio.c
> index 1035774..5593c84 100644
> --- a/hw/hda-audio.c
> +++ b/hw/hda-audio.c
> @@ -808,6 +808,27 @@ static int hda_audio_init(HDACodecDevice *hda, const struct desc_codec *desc)
> return 0;
> }
>
> +static int hda_audio_exit(HDACodecDevice *hda)
> +{
> + HDAAudioState *a = DO_UPCAST(HDAAudioState, hda, hda);
> + HDAAudioStream *st;
> + int i;
> +
> + dprint(a, 1, "%s\n", __FUNCTION__);
> + for (i = 0; i < ARRAY_SIZE(a->st); i++) {
> + st = a->st + i;
> + if (st->node == NULL)
> + continue;
Braces
> + if (st->output) {
> + AUD_close_out(&a->card, st->voice.out);
> + } else {
> + AUD_close_in(&a->card, st->voice.in);
> + }
> + }
> + AUD_remove_card(&a->card);
> + return 0;
> +}
> +
> static int hda_audio_post_load(void *opaque, int version)
> {
> HDAAudioState *a = opaque;
> @@ -879,6 +900,7 @@ static HDACodecDeviceInfo hda_audio_info_output = {
> .qdev.vmsd = &vmstate_hda_audio,
> .qdev.props = hda_audio_properties,
> .init = hda_audio_init_output,
> + .exit = hda_audio_exit,
> .command = hda_audio_command,
> .stream = hda_audio_stream,
> };
> @@ -890,6 +912,7 @@ static HDACodecDeviceInfo hda_audio_info_duplex = {
> .qdev.vmsd = &vmstate_hda_audio,
> .qdev.props = hda_audio_properties,
> .init = hda_audio_init_duplex,
> + .exit = hda_audio_exit,
> .command = hda_audio_command,
> .stream = hda_audio_stream,
> };
>
--
mailto:av1474@comtv.ru
next prev parent reply other threads:[~2010-11-08 17:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-08 13:46 [Qemu-devel] [PATCH 0/4] intel-hda: fixes Gerd Hoffmann
2010-11-08 13:46 ` [Qemu-devel] [PATCH 1/4] intel-hda: exit cleanup Gerd Hoffmann
2010-11-08 13:46 ` [Qemu-devel] [PATCH 2/4] hda-audio: " Gerd Hoffmann
2010-11-08 17:50 ` malc [this message]
2010-11-08 13:46 ` [Qemu-devel] [PATCH 3/4] intel-hda: Honor WAKEEN bits Gerd Hoffmann
2010-11-08 13:46 ` [Qemu-devel] [PATCH 4/4] intel-hda: update irq status on WAKEEN changes Gerd Hoffmann
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=alpine.LNX.2.00.1011082050240.1505@linmac \
--to=av1474@comtv.ru \
--cc=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).