mirror of
https://github.com/mii443/qemu.git
synced 2025-12-03 11:08:25 +00: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:
committed by
Michael S. Tsirkin
parent
7ee6c1e182
commit
9af21dbee1
@@ -315,37 +315,33 @@ PCIBus *pci_pmac_u3_init(qemu_irq *pic,
|
||||
return h->bus;
|
||||
}
|
||||
|
||||
static int unin_main_pci_host_init(PCIDevice *d)
|
||||
static void unin_main_pci_host_realize(PCIDevice *d, Error **errp)
|
||||
{
|
||||
d->config[0x0C] = 0x08; // cache_line_size
|
||||
d->config[0x0D] = 0x10; // latency_timer
|
||||
d->config[0x34] = 0x00; // capabilities_pointer
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int unin_agp_pci_host_init(PCIDevice *d)
|
||||
static void unin_agp_pci_host_realize(PCIDevice *d, Error **errp)
|
||||
{
|
||||
d->config[0x0C] = 0x08; // cache_line_size
|
||||
d->config[0x0D] = 0x10; // latency_timer
|
||||
// d->config[0x34] = 0x80; // capabilities_pointer
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int u3_agp_pci_host_init(PCIDevice *d)
|
||||
static void u3_agp_pci_host_realize(PCIDevice *d, Error **errp)
|
||||
{
|
||||
/* cache line size */
|
||||
d->config[0x0C] = 0x08;
|
||||
/* latency timer */
|
||||
d->config[0x0D] = 0x10;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int unin_internal_pci_host_init(PCIDevice *d)
|
||||
static void unin_internal_pci_host_realize(PCIDevice *d, Error **errp)
|
||||
{
|
||||
d->config[0x0C] = 0x08; // cache_line_size
|
||||
d->config[0x0D] = 0x10; // latency_timer
|
||||
d->config[0x34] = 0x00; // capabilities_pointer
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void unin_main_pci_host_class_init(ObjectClass *klass, void *data)
|
||||
@@ -353,7 +349,7 @@ static void unin_main_pci_host_class_init(ObjectClass *klass, void *data)
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = unin_main_pci_host_init;
|
||||
k->realize = unin_main_pci_host_realize;
|
||||
k->vendor_id = PCI_VENDOR_ID_APPLE;
|
||||
k->device_id = PCI_DEVICE_ID_APPLE_UNI_N_PCI;
|
||||
k->revision = 0x00;
|
||||
@@ -377,7 +373,7 @@ static void u3_agp_pci_host_class_init(ObjectClass *klass, void *data)
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = u3_agp_pci_host_init;
|
||||
k->realize = u3_agp_pci_host_realize;
|
||||
k->vendor_id = PCI_VENDOR_ID_APPLE;
|
||||
k->device_id = PCI_DEVICE_ID_APPLE_U3_AGP;
|
||||
k->revision = 0x00;
|
||||
@@ -401,7 +397,7 @@ static void unin_agp_pci_host_class_init(ObjectClass *klass, void *data)
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = unin_agp_pci_host_init;
|
||||
k->realize = unin_agp_pci_host_realize;
|
||||
k->vendor_id = PCI_VENDOR_ID_APPLE;
|
||||
k->device_id = PCI_DEVICE_ID_APPLE_UNI_N_AGP;
|
||||
k->revision = 0x00;
|
||||
@@ -425,7 +421,7 @@ static void unin_internal_pci_host_class_init(ObjectClass *klass, void *data)
|
||||
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
|
||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||
|
||||
k->init = unin_internal_pci_host_init;
|
||||
k->realize = unin_internal_pci_host_realize;
|
||||
k->vendor_id = PCI_VENDOR_ID_APPLE;
|
||||
k->device_id = PCI_DEVICE_ID_APPLE_UNI_N_I_PCI;
|
||||
k->revision = 0x00;
|
||||
|
||||
Reference in New Issue
Block a user