Skip to content

Commit

Permalink
net: lance: convert SysBus init method to a realize method
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Le Goater <clg@kaod.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-5-clg@kaod.org>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
  • Loading branch information
legoater authored and ehabkost committed Oct 24, 2018
1 parent f71b336 commit 45099c4
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions hw/net/lance.c
Expand Up @@ -97,9 +97,9 @@ static const VMStateDescription vmstate_lance = {
}
};

static int lance_init(SysBusDevice *sbd)
static void lance_realize(DeviceState *dev, Error **errp)
{
DeviceState *dev = DEVICE(sbd);
SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
SysBusPCNetState *d = SYSBUS_PCNET(dev);
PCNetState *s = &d->state;

Expand All @@ -115,7 +115,6 @@ static int lance_init(SysBusDevice *sbd)
s->phys_mem_read = ledma_memory_read;
s->phys_mem_write = ledma_memory_write;
pcnet_common_init(dev, s, &net_lance_info);
return 0;
}

static void lance_reset(DeviceState *dev)
Expand Down Expand Up @@ -144,9 +143,8 @@ static Property lance_properties[] = {
static void lance_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass);

k->init = lance_init;
dc->realize = lance_realize;
set_bit(DEVICE_CATEGORY_NETWORK, dc->categories);
dc->fw_name = "ethernet";
dc->reset = lance_reset;
Expand Down

0 comments on commit 45099c4

Please sign in to comment.