diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-01-19 15:52:30 +0100 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2015-02-26 12:42:16 +0100 |
commit | 9af21dbee14c5165598d17115ade63184ec0dd8b (patch) | |
tree | 8bb365934bdac7cb5e1b2cb7cf1dbc32aea4655a /hw/net/rtl8139.c | |
parent | 7ee6c1e182cca6ccf5253569fca3d05826efb4e9 (diff) |
pci: Trivial device model conversions to realize
Convert the device models where initialization obviously can't fail.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Diffstat (limited to 'hw/net/rtl8139.c')
-rw-r--r-- | hw/net/rtl8139.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/net/rtl8139.c b/hw/net/rtl8139.c index 2d1be06f41..f868108dfe 100644 --- a/hw/net/rtl8139.c +++ b/hw/net/rtl8139.c @@ -3455,7 +3455,7 @@ static NetClientInfo net_rtl8139_info = { .link_status_changed = rtl8139_set_link_status, }; -static int pci_rtl8139_init(PCIDevice *dev) +static void pci_rtl8139_realize(PCIDevice *dev, Error **errp) { RTL8139State *s = RTL8139(dev); DeviceState *d = DEVICE(dev); @@ -3496,8 +3496,6 @@ static int pci_rtl8139_init(PCIDevice *dev) s->cplus_txbuffer_offset = 0; s->timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, rtl8139_timer, s); - - return 0; } static void rtl8139_instance_init(Object *obj) @@ -3519,7 +3517,7 @@ static void rtl8139_class_init(ObjectClass *klass, void *data) DeviceClass *dc = DEVICE_CLASS(klass); PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); - k->init = pci_rtl8139_init; + k->realize = pci_rtl8139_realize; k->exit = pci_rtl8139_uninit; k->romfile = "efi-rtl8139.rom"; k->vendor_id = PCI_VENDOR_ID_REALTEK; |