From patchwork Sat Jan 6 15:37:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Herv=C3=A9_Poussineau?= X-Patchwork-Id: 10147913 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 08C81601BE for ; Sat, 6 Jan 2018 15:54:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAB14289A8 for ; Sat, 6 Jan 2018 15:54:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCCB8289AC; Sat, 6 Jan 2018 15:54:34 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 91303289A8 for ; Sat, 6 Jan 2018 15:54:34 +0000 (UTC) Received: from localhost ([::1]:39999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqnp-0003YL-NS for patchwork-qemu-devel@patchwork.kernel.org; Sat, 06 Jan 2018 10:54:33 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eXqap-0000f6-Fz for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eXqao-0001MX-OY for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:07 -0500 Received: from iserv.reactos.org ([2a01:4f8:221:4c5::3]:42502) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eXqao-0001K1-9h for qemu-devel@nongnu.org; Sat, 06 Jan 2018 10:41:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=reactos.org; s=25047; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=sdFSJJCJUGKbPAHruFgNLVYSxMNP+ZZLQ8Qba9oZvSY=; b=owhB+/8SQ5m0f+AtMbSqLKsTmrxEHKWKNyMvJZy3JNha6eWrgou9w1cQyCFPxbD4xWVdcvSkw+3QTfgCdI6oZcnFRsgBehCvowbXlIG2zbrZ187kg0DS1geiBLYEZ/I9vej3KZpmP1NCYnJw9tEGZwgqwJ3aXkPn5dBnB521x4Y=; Received: from rob92-5-82-227-227-196.fbx.proxad.net ([82.227.227.196] helo=localhost.localdomain) by iserv.reactos.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1eXqag-0003wc-Iq; Sat, 06 Jan 2018 15:40:58 +0000 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= To: Aurelien Jarno , Yongbok Kim , "Michael S . Tsirkin" , Paolo Bonzini , qemu-devel@nongnu.org Date: Sat, 6 Jan 2018 16:37:28 +0100 Message-Id: <20180106153730.30313-15-hpoussin@reactos.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180106153730.30313-1-hpoussin@reactos.org> References: <20180106153730.30313-1-hpoussin@reactos.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:4f8:221:4c5::3 Subject: [Qemu-devel] [PATCH v4 14/16] piix4: convert reset function to QOM 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: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Acked-by: Michael S. Tsirkin Acked-by: Paolo Bonzini Signed-off-by: Hervé Poussineau --- hw/isa/piix4.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c index b313e4fe73..159a27d2d9 100644 --- a/hw/isa/piix4.c +++ b/hw/isa/piix4.c @@ -56,10 +56,10 @@ typedef struct PIIX4State { #define PIIX4_PCI_DEVICE(obj) \ OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE) -static void piix4_reset(void *opaque) +static void piix4_reset(DeviceState *dev) { - PIIX4State *d = opaque; - uint8_t *pci_conf = d->dev.config; + PIIX4State *s = PIIX4_PCI_DEVICE(dev); + uint8_t *pci_conf = s->dev.config; pci_conf[0x04] = 0x07; // master, memory and I/O pci_conf[0x05] = 0x00; @@ -234,7 +234,6 @@ static void piix4_realize(PCIDevice *pci_dev, Error **errp) isa_init_irq(ISA_DEVICE(&s->rtc), &s->rtc.irq, RTC_ISA_IRQ); piix4_dev = pci_dev; - qemu_register_reset(piix4_reset, s); } static void piix4_init(Object *obj) @@ -268,6 +267,7 @@ static void piix4_class_init(ObjectClass *klass, void *data) k->vendor_id = PCI_VENDOR_ID_INTEL; k->device_id = PCI_DEVICE_ID_INTEL_82371AB_0; k->class_id = PCI_CLASS_BRIDGE_ISA; + dc->reset = piix4_reset; dc->desc = "ISA bridge"; dc->vmsd = &vmstate_piix4; /*