From patchwork Wed May 25 01:58:05 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaku Yamahata X-Patchwork-Id: 97275 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F08F7B6F91 for ; Wed, 25 May 2011 12:08:27 +1000 (EST) Received: from localhost ([::1]:49606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QP3WK-0003YU-Ug for incoming@patchwork.ozlabs.org; Tue, 24 May 2011 22:08:24 -0400 Received: from eggs.gnu.org ([140.186.70.92]:36701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QP3N8-0003ZA-Me for qemu-devel@nongnu.org; Tue, 24 May 2011 21:58:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QP3My-0008UB-Ou for qemu-devel@nongnu.org; Tue, 24 May 2011 21:58:54 -0400 Received: from mail.valinux.co.jp ([210.128.90.3]:32906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QP3My-0008S2-EK for qemu-devel@nongnu.org; Tue, 24 May 2011 21:58:44 -0400 Received: from ps.local.valinux.co.jp (vagw.valinux.co.jp [210.128.90.14]) by mail.valinux.co.jp (Postfix) with SMTP id 4166A280E6; Wed, 25 May 2011 10:58:40 +0900 (JST) Received: (nullmailer pid 20999 invoked by uid 1000); Wed, 25 May 2011 01:58:36 -0000 From: Isaku Yamahata To: qemu-devel@nongnu.org Date: Wed, 25 May 2011 10:58:05 +0900 Message-Id: X-Mailer: git-send-email 1.7.1.1 In-Reply-To: References: In-Reply-To: References: X-Virus-Scanned: clamav-milter 0.95.2 at va-mail.local.valinux.co.jp X-Virus-Status: Clean X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 210.128.90.3 Cc: yamahata@valinux.co.jp, mst@redhat.com Subject: [Qemu-devel] [PATCH v3 08/39] hw/ac97.c: convert to PCIDeviceInfo to initialize ids X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org use PCIDeviceInfo to initialize ids. Signed-off-by: Isaku Yamahata --- hw/ac97.c | 9 ++++----- 1 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hw/ac97.c b/hw/ac97.c index d71072d..c26a86d 100644 --- a/hw/ac97.c +++ b/hw/ac97.c @@ -1281,9 +1281,6 @@ static int ac97_initfn (PCIDevice *dev) AC97LinkState *s = DO_UPCAST (AC97LinkState, dev, dev); uint8_t *c = s->dev.config; - pci_config_set_vendor_id (c, PCI_VENDOR_ID_INTEL); /* ro */ - pci_config_set_device_id (c, PCI_DEVICE_ID_INTEL_82801AA_5); /* ro */ - /* TODO: no need to override */ c[PCI_COMMAND] = 0x00; /* pcicmd pci command rw, ro */ c[PCI_COMMAND + 1] = 0x00; @@ -1292,9 +1289,7 @@ static int ac97_initfn (PCIDevice *dev) c[PCI_STATUS] = PCI_STATUS_FAST_BACK; /* pcists pci status rwc, ro */ c[PCI_STATUS + 1] = PCI_STATUS_DEVSEL_MEDIUM >> 8; - c[PCI_REVISION_ID] = 0x01; /* rid revision ro */ c[PCI_CLASS_PROG] = 0x00; /* pi programming interface ro */ - pci_config_set_class (c, PCI_CLASS_MULTIMEDIA_AUDIO); /* ro */ /* TODO set when bar is registered. no need to override. */ /* nabmar native audio mixer base address rw */ @@ -1341,6 +1336,10 @@ static PCIDeviceInfo ac97_info = { .qdev.size = sizeof (AC97LinkState), .qdev.vmsd = &vmstate_ac97, .init = ac97_initfn, + .vendor_id = PCI_VENDOR_ID_INTEL, + .device_id = PCI_DEVICE_ID_INTEL_82801AA_5, + .revision = 0x01, + .class_id = PCI_CLASS_MULTIMEDIA_AUDIO, }; static void ac97_register (void)