aboutsummaryrefslogtreecommitdiff
path: root/hw/net/ne2000.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-01-19 15:52:30 +0100
committerMichael S. Tsirkin <mst@redhat.com>2015-02-26 12:42:16 +0100
commit9af21dbee14c5165598d17115ade63184ec0dd8b (patch)
tree8bb365934bdac7cb5e1b2cb7cf1dbc32aea4655a /hw/net/ne2000.c
parent7ee6c1e182cca6ccf5253569fca3d05826efb4e9 (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/ne2000.c')
-rw-r--r--hw/net/ne2000.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 4dea70178d..3492db3663 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -709,7 +709,7 @@ static NetClientInfo net_ne2000_info = {
.receive = ne2000_receive,
};
-static int pci_ne2000_init(PCIDevice *pci_dev)
+static void pci_ne2000_realize(PCIDevice *pci_dev, Error **errp)
{
PCINE2000State *d = DO_UPCAST(PCINE2000State, dev, pci_dev);
NE2000State *s;
@@ -729,8 +729,6 @@ static int pci_ne2000_init(PCIDevice *pci_dev)
s->nic = qemu_new_nic(&net_ne2000_info, &s->c,
object_get_typename(OBJECT(pci_dev)), pci_dev->qdev.id, s);
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->c.macaddr.a);
-
- return 0;
}
static void pci_ne2000_exit(PCIDevice *pci_dev)
@@ -763,7 +761,7 @@ static void ne2000_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
- k->init = pci_ne2000_init;
+ k->realize = pci_ne2000_realize;
k->exit = pci_ne2000_exit;
k->romfile = "efi-ne2k_pci.rom",
k->vendor_id = PCI_VENDOR_ID_REALTEK;