From nobody Wed May 1 19:23:29 2024 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; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 153851830094754.04283333239846; Tue, 2 Oct 2018 15:11:40 -0700 (PDT) Received: from localhost ([::1]:45900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7StH-0004q6-CV for importer@patchew.org; Tue, 02 Oct 2018 18:11:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52043) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g7Src-0003lb-EK for qemu-devel@nongnu.org; Tue, 02 Oct 2018 18:09:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g7Sbb-0003be-D0 for qemu-devel@nongnu.org; Tue, 02 Oct 2018 17:53:26 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:36834) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g7Sbb-0003Tx-5D; Tue, 02 Oct 2018 17:53:23 -0400 Received: by mail-wm1-x343.google.com with SMTP id n23-v6so3625742wmc.1; Tue, 02 Oct 2018 14:53:23 -0700 (PDT) Received: from x1.local (26.red-83-32-208.dynamicip.rima-tde.net. [83.32.208.26]) by smtp.gmail.com with ESMTPSA id y7-v6sm2469091wmy.27.2018.10.02.14.53.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 14:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mX81OkbSXja7b8GLRmkUmNRQpjFXN//MSzu5WTpbEMA=; b=KyJ1HNDNnDlGypG14m9lOLS3h7Qziya9g2Q8EwzoP+yIGSOsZb2rYrtOBvagsycsG+ Lptrrv+IU1+7B/mjr/TBvjoKf7zyqvWTFBgvJpSyvlkOfqKxg8WSpi6sgOZaJLYJO+LJ ab2xau7og3BEgrd7+vxYrDmNnl+1C9zry7PC39QLFAmFdqaQCr4lMnPHOJfL4TkA69Fs G5ZtOh6un8qVdM1GZyrYCaW0VGbwbnrE8TTAYGYKg03H8jZK3KUIve0ToMcufOh1V+Zb RNmnO4Rw1K3df5Hs8GTfENrz4hEUy6y4Y6j0M1d0h+y427Sdggj159bok0Y+YgCbf6D5 MRZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=mX81OkbSXja7b8GLRmkUmNRQpjFXN//MSzu5WTpbEMA=; b=RFocEuI+sY7UKRA1+iOpDsCxgPbIhOTekAeIx6cWSKniL6qQ8NM9mv4cKeohQrGusU pYYv+TbLUiZURNfUxqJu2C/YbUSBGIS0NATBdev6iQ74qQOC4iTvdKIPapac6IsAGwdP BcZxWIF/JHW0xlGbdiVcQs7pnNIcQAFnMvcRvks1KbzD1LC6MP/2pvjGPhyOLFo1QW75 ZoRis6nQ0xrC3EEY1YbIK4VpLFoCszEW7HvbL1MJD1n8lc2vESDRjrfDJcG26arNHSGD u7KVv9lDNEGSlxYxy/UPs5sqgFjaAOaPARb6F86IrZmmSfbSKrST8NBvCmoxZqE0SL+5 F5OA== X-Gm-Message-State: ABuFfogsrFPR3hqEYUTr2XtKaLvECEIuPlvZVGduDcrFyk8PbOrWeVsZ jiGCj2hubhkgtOcv0eY+EG0= X-Google-Smtp-Source: ACcGV620HG5Hp6kpFd7686ICTQIQqN8w0OGH422VuKsKZxmccJtTPRLdVy61BDakiSAh6UZTKFsdeg== X-Received: by 2002:a1c:ee15:: with SMTP id m21-v6mr3075512wmh.124.1538517202069; Tue, 02 Oct 2018 14:53:22 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Greg Kurz Date: Tue, 2 Oct 2018 23:53:15 +0200 Message-Id: <20181002215315.16851-1-f4bug@amsat.org> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH] hw/pci-host/ppce500: Use DeviceState::realize rather than SysBusDevice::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: Peter Maydell , Eduardo Habkost , qemu-devel@nongnu.org, Alexander Graf , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , "open list:ppce500" Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Move from the legacy SysBusDevice::init method to using DeviceState::realiz= e. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/pci-host/ppce500.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/hw/pci-host/ppce500.c b/hw/pci-host/ppce500.c index eb75e080fc..b8f8c112e6 100644 --- a/hw/pci-host/ppce500.c +++ b/hw/pci-host/ppce500.c @@ -436,8 +436,9 @@ static AddressSpace *e500_pcihost_set_iommu(PCIBus *bus= , void *opaque, return &s->bm_as; } =20 -static int e500_pcihost_initfn(SysBusDevice *dev) +static void e500_pcihost_realize(DeviceState *dev, Error **errp) { + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); PCIHostState *h; PPCE500PCIState *s; PCIBus *b; @@ -447,7 +448,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev) s =3D PPC_E500_PCI_HOST_BRIDGE(dev); =20 for (i =3D 0; i < ARRAY_SIZE(s->irq); i++) { - sysbus_init_irq(dev, &s->irq[i]); + sysbus_init_irq(sbd, &s->irq[i]); } =20 for (i =3D 0; i < PCI_NUM_PINS; i++) { @@ -460,7 +461,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev) /* PIO lives at the bottom of our bus space */ memory_region_add_subregion_overlap(&s->busmem, 0, &s->pio, -2); =20 - b =3D pci_register_root_bus(DEVICE(dev), NULL, mpc85xx_pci_set_irq, + b =3D pci_register_root_bus(dev, NULL, mpc85xx_pci_set_irq, mpc85xx_pci_map_irq, s, &s->busmem, &s->pio, PCI_DEVFN(s->first_slot, 0), 4, TYPE_PCI_BUS= ); h->bus =3D b; @@ -483,10 +484,8 @@ static int e500_pcihost_initfn(SysBusDevice *dev) memory_region_add_subregion(&s->container, PCIE500_CFGADDR, &h->conf_m= em); memory_region_add_subregion(&s->container, PCIE500_CFGDATA, &h->data_m= em); memory_region_add_subregion(&s->container, PCIE500_REG_BASE, &s->iomem= ); - sysbus_init_mmio(dev, &s->container); + sysbus_init_mmio(sbd, &s->container); pci_bus_set_route_irq_fn(b, e500_route_intx_pin_to_irq); - - return 0; } =20 static void e500_host_bridge_class_init(ObjectClass *klass, void *data) @@ -526,9 +525,8 @@ static Property pcihost_properties[] =3D { static void e500_pcihost_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D e500_pcihost_initfn; + dc->realize =3D e500_pcihost_realize; set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories); dc->props =3D pcihost_properties; dc->vmsd =3D &vmstate_ppce500_pci; --=20 2.19.0