diff options
author | Cédric Le Goater <clg@kaod.org> | 2018-10-01 08:37:55 +0200 |
---|---|---|
committer | Eduardo Habkost <ehabkost@redhat.com> | 2018-10-24 06:44:59 -0300 |
commit | f71b3367a243058215e3724be8d661c67bf94d8e (patch) | |
tree | b1bda65e0caed291173df06c12002adf9ab693fd /hw/net | |
parent | 56dff42a2ca3d26968c6f211c8e978bdbf5006a3 (diff) |
net: lan9118: convert SysBus init method to a realize method
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20181001063803.22330-4-clg@kaod.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/net')
-rw-r--r-- | hw/net/lan9118.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/hw/net/lan9118.c b/hw/net/lan9118.c index b9032dac59..a6269d9463 100644 --- a/hw/net/lan9118.c +++ b/hw/net/lan9118.c @@ -1320,9 +1320,9 @@ static NetClientInfo net_lan9118_info = { .link_status_changed = lan9118_set_link, }; -static int lan9118_init1(SysBusDevice *sbd) +static void lan9118_realize(DeviceState *dev, Error **errp) { - DeviceState *dev = DEVICE(sbd); + SysBusDevice *sbd = SYS_BUS_DEVICE(dev); lan9118_state *s = LAN9118(dev); QEMUBH *bh; int i; @@ -1349,8 +1349,6 @@ static int lan9118_init1(SysBusDevice *sbd) s->timer = ptimer_init(bh, PTIMER_POLICY_DEFAULT); ptimer_set_freq(s->timer, 10000); ptimer_set_limit(s->timer, 0xffff, 1); - - return 0; } static Property lan9118_properties[] = { @@ -1362,12 +1360,11 @@ static Property lan9118_properties[] = { static void lan9118_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); - k->init = lan9118_init1; dc->reset = lan9118_reset; dc->props = lan9118_properties; dc->vmsd = &vmstate_lan9118; + dc->realize = lan9118_realize; } static const TypeInfo lan9118_info = { |