From patchwork Wed Jan 11 09:33:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9509591 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 84E6B60762 for ; Wed, 11 Jan 2017 09:34:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F62320572 for ; Wed, 11 Jan 2017 09:34:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7379728456; Wed, 11 Jan 2017 09:34:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9E8A20572 for ; Wed, 11 Jan 2017 09:34:29 +0000 (UTC) Received: from localhost ([::1]:52537 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRFIZ-0004cO-TI for patchwork-qemu-devel@patchwork.kernel.org; Wed, 11 Jan 2017 04:34:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cRFI4-0004bg-Tv for qemu-devel@nongnu.org; Wed, 11 Jan 2017 04:33:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cRFI1-0006GJ-Pc for qemu-devel@nongnu.org; Wed, 11 Jan 2017 04:33:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48662) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cRFI1-0006G8-Jk for qemu-devel@nongnu.org; Wed, 11 Jan 2017 04:33:53 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BD9A983F3A for ; Wed, 11 Jan 2017 09:33:53 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-51.ams2.redhat.com [10.36.116.51]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0B9XqWh024134; Wed, 11 Jan 2017 04:33:53 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 84C2A80B1C; Wed, 11 Jan 2017 10:33:49 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 11 Jan 2017 10:33:47 +0100 Message-Id: <1484127227-26496-6-git-send-email-kraxel@redhat.com> In-Reply-To: <1484127227-26496-1-git-send-email-kraxel@redhat.com> References: <1484127227-26496-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 11 Jan 2017 09:33:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 5/5] es1370: wire up reset via DeviceClass X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Instead of using qemu_register_reset(). That way we get proper cleanup for free. Signed-off-by: Gerd Hoffmann 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 = {