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>
This commit is contained in:
Markus Armbruster 2015-01-19 15:52:30 +01:00 committed by Michael S. Tsirkin
parent 7ee6c1e182
commit 9af21dbee1
34 changed files with 87 additions and 152 deletions

View file

@ -1298,7 +1298,7 @@ static const MemoryRegionOps vmsvga_io_ops = {
},
};
static int pci_vmsvga_initfn(PCIDevice *dev)
static void pci_vmsvga_realize(PCIDevice *dev, Error **errp)
{
struct pci_vmsvga_state_s *s = VMWARE_SVGA(dev);
@ -1323,8 +1323,6 @@ static int pci_vmsvga_initfn(PCIDevice *dev)
/* compatibility with pc-0.13 and older */
vga_init_vbe(&s->chip.vga, OBJECT(dev), pci_address_space(dev));
}
return 0;
}
static Property vga_vmware_properties[] = {
@ -1338,7 +1336,7 @@ static void vmsvga_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
k->init = pci_vmsvga_initfn;
k->realize = pci_vmsvga_realize;
k->romfile = "vgabios-vmware.bin";
k->vendor_id = PCI_VENDOR_ID_VMWARE;
k->device_id = SVGA_PCI_DEVICE_ID;