From nobody Sat Oct 25 23:33:53 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1521516701551849.8181289022262; Mon, 19 Mar 2018 20:31:41 -0700 (PDT) Received: from localhost ([::1]:45277 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey7zw-0001fU-IX for importer@patchew.org; Mon, 19 Mar 2018 23:31:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ey7m7-0006Wa-3Y for qemu-devel@nongnu.org; Mon, 19 Mar 2018 23:17:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ey7m5-00081r-RL for qemu-devel@nongnu.org; Mon, 19 Mar 2018 23:17:23 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:56982 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ey7m5-00081g-MV for qemu-devel@nongnu.org; Mon, 19 Mar 2018 23:17:21 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5305A8185928; Tue, 20 Mar 2018 03:17:21 +0000 (UTC) Received: from redhat.com (ovpn-121-0.rdu2.redhat.com [10.10.121.0]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EC68215CDA7; Tue, 20 Mar 2018 03:17:21 +0000 (UTC) Date: Tue, 20 Mar 2018 05:17:20 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1521515720-612046-16-git-send-email-mst@redhat.com> References: <1521515720-612046-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1521515720-612046-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 20 Mar 2018 03:17:21 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Tue, 20 Mar 2018 03:17:21 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.187.233.73 Subject: [Qemu-devel] [PULL v2 15/50] hw/pci: remove obsolete PCIDevice->init() 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: Marcel Apfelbaum , Peter Maydell , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" From: Philippe Mathieu-Daud=C3=A9 All PCI devices are now QOM'ified. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Marcel Apfelbaum Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/pci/pci.h | 1 - hw/pci/pci.c | 14 -------------- 2 files changed, 15 deletions(-) diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index d8c18c7..e28f3fa 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -217,7 +217,6 @@ typedef struct PCIDeviceClass { DeviceClass parent_class; =20 void (*realize)(PCIDevice *dev, Error **errp); - int (*init)(PCIDevice *dev);/* TODO convert to realize() and remove */ PCIUnregisterFunc *exit; PCIConfigReadFunc *config_read; PCIConfigWriteFunc *config_write; diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 2174c25..f98efdc 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -2049,18 +2049,6 @@ static void pci_qdev_realize(DeviceState *qdev, Erro= r **errp) } } =20 -static void pci_default_realize(PCIDevice *dev, Error **errp) -{ - PCIDeviceClass *pc =3D PCI_DEVICE_GET_CLASS(dev); - - if (pc->init) { - if (pc->init(dev) < 0) { - error_setg(errp, "Device initialization failed"); - return; - } - } -} - PCIDevice *pci_create_multifunction(PCIBus *bus, int devfn, bool multifunc= tion, const char *name) { @@ -2533,13 +2521,11 @@ MemoryRegion *pci_address_space_io(PCIDevice *dev) static void pci_device_class_init(ObjectClass *klass, void *data) { DeviceClass *k =3D DEVICE_CLASS(klass); - PCIDeviceClass *pc =3D PCI_DEVICE_CLASS(klass); =20 k->realize =3D pci_qdev_realize; k->unrealize =3D pci_qdev_unrealize; k->bus_type =3D TYPE_PCI_BUS; k->props =3D pci_props; - pc->realize =3D pci_default_realize; } =20 static void pci_device_class_base_init(ObjectClass *klass, void *data) --=20 MST