[libvirt] [PULL 42/45] net: stellaris_enet: convert SysBus init method to a realize method
David Gibson
david at gibson.dropbear.id.au
Tue Oct 23 15:26:19 UTC 2018
On Thu, Oct 18, 2018 at 05:04:19PM -0300, Eduardo Habkost wrote:
> From: Cédric Le Goater <clg at kaod.org>
>
> Cc: Peter Maydell <peter.maydell at linaro.org>
> Cc: qemu-arm at nongnu.org
> Signed-off-by: Cédric Le Goater <clg at kaod.org>
> Reviewed-by: Peter Maydell <peter.maydell at linaro.org>
> Reviewed-by: Philippe Mathieu-Daudé <philmd at redhat.com>
> Message-Id: <20181001063803.22330-10-clg at kaod.org>
> Signed-off-by: Eduardo Habkost <ehabkost at redhat.com>
Reviewed-by: David Gibson <david at gibson.dropbear.id.au>
> ---
> hw/net/stellaris_enet.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/hw/net/stellaris_enet.c b/hw/net/stellaris_enet.c
> index 165562d788..3ee1e0f8a4 100644
> --- a/hw/net/stellaris_enet.c
> +++ b/hw/net/stellaris_enet.c
> @@ -473,9 +473,9 @@ static NetClientInfo net_stellaris_enet_info = {
> .receive = stellaris_enet_receive,
> };
>
> -static int stellaris_enet_init(SysBusDevice *sbd)
> +static void stellaris_enet_realize(DeviceState *dev, Error **errp)
> {
> - DeviceState *dev = DEVICE(sbd);
> + SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
> stellaris_enet_state *s = STELLARIS_ENET(dev);
>
> memory_region_init_io(&s->mmio, OBJECT(s), &stellaris_enet_ops, s,
> @@ -489,7 +489,6 @@ static int stellaris_enet_init(SysBusDevice *sbd)
> qemu_format_nic_info_str(qemu_get_queue(s->nic), s->conf.macaddr.a);
>
> stellaris_enet_reset(s);
> - return 0;
> }
>
> static Property stellaris_enet_properties[] = {
> @@ -500,9 +499,8 @@ static Property stellaris_enet_properties[] = {
> static void stellaris_enet_class_init(ObjectClass *klass, void *data)
> {
> DeviceClass *dc = DEVICE_CLASS(klass);
> - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);
>
> - k->init = stellaris_enet_init;
> + dc->realize = stellaris_enet_realize;
> dc->props = stellaris_enet_properties;
> dc->vmsd = &vmstate_stellaris_enet;
> }
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20181023/d7b3cc16/attachment-0001.sig>
More information about the libvir-list
mailing list