From nobody Thu Nov 6 01:12:41 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538143066298542.1495850659892; Fri, 28 Sep 2018 06:57:46 -0700 (PDT) Received: from localhost ([::1]:43536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5tH6-00029g-L8 for importer@patchew.org; Fri, 28 Sep 2018 09:57:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56010) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5tAW-0004oV-JY for qemu-devel@nongnu.org; Fri, 28 Sep 2018 09:51:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5tAS-000777-Ho for qemu-devel@nongnu.org; Fri, 28 Sep 2018 09:50:56 -0400 Received: from 8.mo7.mail-out.ovh.net ([46.105.77.114]:38599) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1g5tAS-00076Z-9D for qemu-devel@nongnu.org; Fri, 28 Sep 2018 09:50:52 -0400 Received: from player691.ha.ovh.net (unknown [10.109.160.217]) by mo7.mail-out.ovh.net (Postfix) with ESMTP id 22BA8DF799 for ; Fri, 28 Sep 2018 15:50:51 +0200 (CEST) Received: from zorba.kaod.org.com (LFbn-1-10605-110.w90-89.abo.wanadoo.fr [90.89.196.110]) (Authenticated sender: clg@kaod.org) by player691.ha.ovh.net (Postfix) with ESMTPSA id CD2A62600BA; Fri, 28 Sep 2018 15:50:46 +0200 (CEST) From: =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= To: Jason Wang , qemu-devel@nongnu.org Date: Fri, 28 Sep 2018 15:50:00 +0200 Message-Id: <20180928135003.8650-9-clg@kaod.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180928135003.8650-1-clg@kaod.org> References: <20180928135003.8650-1-clg@kaod.org> MIME-Version: 1.0 X-Ovh-Tracer-Id: 3583176454062246911 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtjedruddtledgjedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddm Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 46.105.77.114 Subject: [Qemu-devel] [PATCH 08/11] net: smc91c111: convert SysBus init method to a realize method 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 , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= 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" Signed-off-by: C=C3=A9dric Le Goater --- hw/net/smc91c111.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/hw/net/smc91c111.c b/hw/net/smc91c111.c index d2fd2040e81c..5a43afc0d3c2 100644 --- a/hw/net/smc91c111.c +++ b/hw/net/smc91c111.c @@ -766,9 +766,9 @@ static NetClientInfo net_smc91c111_info =3D { .receive =3D smc91c111_receive, }; =20 -static int smc91c111_init1(SysBusDevice *sbd) +static void smc91c111_realize(DeviceState *dev, Error **errp) { - DeviceState *dev =3D DEVICE(sbd); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); smc91c111_state *s =3D SMC91C111(dev); =20 memory_region_init_io(&s->mmio, OBJECT(s), &smc91c111_mem_ops, s, @@ -780,7 +780,6 @@ static int smc91c111_init1(SysBusDevice *sbd) object_get_typename(OBJECT(dev)), dev->id, s); qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a); /* ??? Save/restore. */ - return 0; } =20 static Property smc91c111_properties[] =3D { @@ -791,9 +790,8 @@ static Property smc91c111_properties[] =3D { static void smc91c111_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D smc91c111_init1; + dc->realize =3D smc91c111_realize; dc->reset =3D smc91c111_reset; dc->vmsd =3D &vmstate_smc91c111; dc->props =3D smc91c111_properties; @@ -815,16 +813,14 @@ static void smc91c111_register_types(void) implemented. */ void smc91c111_init(NICInfo *nd, uint32_t base, qemu_irq irq) { - DeviceState *dev; - SysBusDevice *s; + Object *obj; =20 qemu_check_nic_model(nd, "smc91c111"); - dev =3D qdev_create(NULL, TYPE_SMC91C111); - qdev_set_nic_properties(dev, nd); - qdev_init_nofail(dev); - s =3D SYS_BUS_DEVICE(dev); - sysbus_mmio_map(s, 0, base); - sysbus_connect_irq(s, 0, irq); + obj =3D object_new(TYPE_SMC91C111); + qdev_set_nic_properties(DEVICE(obj), nd); + qdev_init_nofail(DEVICE(obj)); + sysbus_mmio_map(SYS_BUS_DEVICE(obj), 0, base); + sysbus_connect_irq(SYS_BUS_DEVICE(obj), 0, irq); } =20 type_init(smc91c111_register_types) --=20 2.17.1