From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDEbr-0003Xm-9l for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:09:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDEbp-000456-9L for qemu-devel@nongnu.org; Thu, 18 Oct 2018 16:09:31 -0400 From: Eduardo Habkost Date: Thu, 18 Oct 2018 17:04:14 -0300 Message-Id: <20181018200422.4358-38-ehabkost@redhat.com> In-Reply-To: <20181018200422.4358-1-ehabkost@redhat.com> References: <20181018200422.4358-1-ehabkost@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 37/45] net: lance: convert SysBus init method to a realize method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell , qemu-devel@nongnu.org Cc: Paolo Bonzini , Alexander Graf , Rob Herring , libvir-list@redhat.com, Richard Henderson , David Gibson , Eric Blake , Igor Mammedov , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Peter Crosthwaite , Markus Armbruster , Artyom Tarasenko , Mark Cave-Ayland , Eduardo Habkost , Michael Walle , Marcel Apfelbaum , Aleksandar Markovic , Aurelien Jarno , Alistair Francis , "Michael S. Tsirkin" , Jason Wang , qemu-ppc@nongnu.org, Xiao Guangrong , Max Filippov , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= From: C=C3=A9dric Le Goater Signed-off-by: C=C3=A9dric Le Goater Reviewed-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Message-Id: <20181001063803.22330-5-clg@kaod.org> Signed-off-by: Eduardo Habkost --- hw/net/lance.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/net/lance.c b/hw/net/lance.c index a08d5ac6a8..f987b2fd18 100644 --- a/hw/net/lance.c +++ b/hw/net/lance.c @@ -97,9 +97,9 @@ static const VMStateDescription vmstate_lance =3D { } }; =20 -static int lance_init(SysBusDevice *sbd) +static void lance_realize(DeviceState *dev, Error **errp) { - DeviceState *dev =3D DEVICE(sbd); + SysBusDevice *sbd =3D SYS_BUS_DEVICE(dev); SysBusPCNetState *d =3D SYSBUS_PCNET(dev); PCNetState *s =3D &d->state; =20 @@ -115,7 +115,6 @@ static int lance_init(SysBusDevice *sbd) s->phys_mem_read =3D ledma_memory_read; s->phys_mem_write =3D ledma_memory_write; pcnet_common_init(dev, s, &net_lance_info); - return 0; } =20 static void lance_reset(DeviceState *dev) @@ -144,9 +143,8 @@ static Property lance_properties[] =3D { static void lance_class_init(ObjectClass *klass, void *data) { DeviceClass *dc =3D DEVICE_CLASS(klass); - SysBusDeviceClass *k =3D SYS_BUS_DEVICE_CLASS(klass); =20 - k->init =3D lance_init; + dc->realize =3D lance_realize; set_bit(DEVICE_CATEGORY_NETWORK, dc->categories); dc->fw_name =3D "ethernet"; dc->reset =3D lance_reset; --=20 2.18.0.rc1.1.g3f1ff2140