From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MLeO9-0007VY-Q2 for qemu-devel@nongnu.org; Tue, 30 Jun 2009 10:32:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MLeO5-0007SW-KS for qemu-devel@nongnu.org; Tue, 30 Jun 2009 10:32:49 -0400 Received: from [199.232.76.173] (port=60570 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MLeO5-0007SE-CT for qemu-devel@nongnu.org; Tue, 30 Jun 2009 10:32:45 -0400 Received: from mx2.redhat.com ([66.187.237.31]:42139) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MLeO4-0001L5-SB for qemu-devel@nongnu.org; Tue, 30 Jun 2009 10:32:45 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n5UEWiN7028776 for ; Tue, 30 Jun 2009 10:32:44 -0400 Message-ID: <4A4A2207.8030604@redhat.com> Date: Tue, 30 Jun 2009 16:32:39 +0200 From: Gerd Hoffmann MIME-Version: 1.0 References: <1246363933-29564-1-git-send-email-kraxel@redhat.com> <1246363933-29564-7-git-send-email-kraxel@redhat.com> In-Reply-To: <1246363933-29564-7-git-send-email-kraxel@redhat.com> Content-Type: multipart/mixed; boundary="------------080506080709080500090907" Subject: [Qemu-devel] Re: [PATCH 6/7] qdev: convert es1370. List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------080506080709080500090907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit updated version, formated consistently with audio/ --------------080506080709080500090907 Content-Type: text/plain; name="0001-qdev-convert-es1370.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-qdev-convert-es1370.patch" >>From 4e9911d94038ba668a4d8f00f40af483fbf412b7 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 19 Jun 2009 14:14:40 +0200 Subject: [PATCH 1/2] qdev: convert es1370. --- hw/es1370.c | 41 ++++++++++++++++++++++------------------- 1 files changed, 22 insertions(+), 19 deletions(-) diff --git a/hw/es1370.c b/hw/es1370.c index f730766..baad7cc 100644 --- a/hw/es1370.c +++ b/hw/es1370.c @@ -1005,27 +1005,12 @@ static void es1370_on_reset (void *opaque) es1370_reset (s); } -int es1370_init (PCIBus *bus) +static void es1370_initfn(PCIDevice *dev) { - PCIES1370State *d; - ES1370State *s; - uint8_t *c; - - if (!bus) { - dolog ("No PCI bus\n"); - return -1; - } - - d = (PCIES1370State *) pci_register_device (bus, "ES1370", - sizeof (PCIES1370State), - -1, NULL, NULL); - - if (!d) { - AUD_log (NULL, "Failed to register PCI device for ES1370\n"); - return -1; - } + PCIES1370State *d = DO_UPCAST (PCIES1370State, dev, dev); + ES1370State *s = &d->es1370; + uint8_t *c = d->dev.config; - c = d->dev.config; pci_config_set_vendor_id (c, PCI_VENDOR_ID_ENSONIQ); pci_config_set_device_id (c, PCI_DEVICE_ID_ENSONIQ_ES1370); c[0x07] = 2 << 1; @@ -1059,5 +1044,23 @@ int es1370_init (PCIBus *bus) AUD_register_card ("es1370", &s->card); es1370_reset (s); +} + +int es1370_init (PCIBus *bus) +{ + pci_create_simple (bus, -1, "ES1370"); return 0; } + +static PCIDeviceInfo es1370_info = { + .qdev.name = "ES1370", + .qdev.size = sizeof (PCIES1370State), + .init = es1370_initfn, +}; + +static void es1370_register(void) +{ + pci_qdev_register (&es1370_info); +} +device_init (es1370_register); + -- 1.6.2.5 --------------080506080709080500090907--