mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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:
parent
7ee6c1e182
commit
9af21dbee1
34 changed files with 87 additions and 152 deletions
|
@ -233,7 +233,7 @@ static const MemoryRegionOps pci_testdev_pio_ops = {
|
|||
},
|
||||
};
|
||||
|
||||
static int pci_testdev_init(PCIDevice *pci_dev)
|
||||
static void pci_testdev_realize(PCIDevice *pci_dev, Error **errp)
|
||||
{
|
||||
PCITestDevState *d = PCI_TEST_DEV(pci_dev);
|
||||
uint8_t *pci_conf;
|
||||
|
@ -275,8 +275,6 @@ static int pci_testdev_init(PCIDevice *pci_dev)
|
|||
assert(r >= 0);
|
||||
test->hasnotifier = true;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -306,7 +304,7 @@ static void pci_testdev_class_init(ObjectClass *klass, void *data)
|
|||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
|
||||
k->init = pci_testdev_init;
|
||||
k->realize = pci_testdev_realize;
|
||||
k->exit = pci_testdev_uninit;
|
||||
k->vendor_id = PCI_VENDOR_ID_REDHAT;
|
||||
k->device_id = PCI_DEVICE_ID_REDHAT_TEST;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue