提交 8fa922c2 编写于 作者: C Cédric Le Goater 提交者: Eduardo Habkost

net: xgmac: convert SysBus init method to a realize method

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: NCédric Le Goater <clg@kaod.org>
Reviewed-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20181001063803.22330-12-clg@kaod.org>
Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
上级 b11ff5ec
...@@ -374,9 +374,9 @@ static NetClientInfo net_xgmac_enet_info = { ...@@ -374,9 +374,9 @@ static NetClientInfo net_xgmac_enet_info = {
.receive = eth_rx, .receive = eth_rx,
}; };
static int xgmac_enet_init(SysBusDevice *sbd) static void xgmac_enet_realize(DeviceState *dev, Error **errp)
{ {
DeviceState *dev = DEVICE(sbd); SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
XgmacState *s = XGMAC(dev); XgmacState *s = XGMAC(dev);
memory_region_init_io(&s->iomem, OBJECT(s), &enet_mem_ops, s, memory_region_init_io(&s->iomem, OBJECT(s), &enet_mem_ops, s,
...@@ -397,8 +397,6 @@ static int xgmac_enet_init(SysBusDevice *sbd) ...@@ -397,8 +397,6 @@ static int xgmac_enet_init(SysBusDevice *sbd)
(s->conf.macaddr.a[2] << 16) | (s->conf.macaddr.a[2] << 16) |
(s->conf.macaddr.a[1] << 8) | (s->conf.macaddr.a[1] << 8) |
s->conf.macaddr.a[0]; s->conf.macaddr.a[0];
return 0;
} }
static Property xgmac_properties[] = { static Property xgmac_properties[] = {
...@@ -408,10 +406,9 @@ static Property xgmac_properties[] = { ...@@ -408,10 +406,9 @@ static Property xgmac_properties[] = {
static void xgmac_enet_class_init(ObjectClass *klass, void *data) static void xgmac_enet_class_init(ObjectClass *klass, void *data)
{ {
SysBusDeviceClass *sbc = SYS_BUS_DEVICE_CLASS(klass);
DeviceClass *dc = DEVICE_CLASS(klass); DeviceClass *dc = DEVICE_CLASS(klass);
sbc->init = xgmac_enet_init; dc->realize = xgmac_enet_realize;
dc->vmsd = &vmstate_xgmac; dc->vmsd = &vmstate_xgmac;
dc->props = xgmac_properties; dc->props = xgmac_properties;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册