aboutsummaryrefslogtreecommitdiff
path: root/hw/pci-host/bonito.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/pci-host/bonito.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/pci-host/bonito.c')
-rw-r--r--hw/pci-host/bonito.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/hw/pci-host/bonito.c b/hw/pci-host/bonito.c
index 56292adb03..8bdd56922a 100644
--- a/hw/pci-host/bonito.c
+++ b/hw/pci-host/bonito.c
@@ -705,7 +705,7 @@ static int bonito_pcihost_initfn(SysBusDevice *dev)
return 0;
}
-static int bonito_initfn(PCIDevice *dev)
+static void bonito_realize(PCIDevice *dev, Error **errp)
{
PCIBonitoState *s = DO_UPCAST(PCIBonitoState, dev, dev);
SysBusDevice *sysbus = SYS_BUS_DEVICE(s->pcihost);
@@ -766,8 +766,6 @@ static int bonito_initfn(PCIDevice *dev)
pci_set_byte(dev->config + PCI_MAX_LAT, 0x00);
qemu_register_reset(bonito_reset, s);
-
- return 0;
}
PCIBus *bonito_init(qemu_irq *pic)
@@ -799,7 +797,7 @@ static void bonito_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
- k->init = bonito_initfn;
+ k->realize = bonito_realize;
k->vendor_id = 0xdf53;
k->device_id = 0x00d5;
k->revision = 0x01;