aboutsummaryrefslogtreecommitdiff
path: root/hw/versatile_pci.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2009-06-30 14:12:07 +0200
committerPaul Brook <paul@codesourcery.com>2009-07-09 13:07:02 +0100
commit0aab0d3a4a62505ab7e79ee0a67fe3f04f6dae23 (patch)
tree59539fa84519cc5cc7aa24c4c7cb0435edfbdfbb /hw/versatile_pci.c
parente2b19c85ea0f3fd6091386adfd3a2acd21107cb4 (diff)
qdev: update pci device registration.
Makes pci_qdev_register take a PCIDeviceInfo struct instead of a bunch of parameters. Also adds config_read and config_write callbacks to PCIDeviceInfo, so drivers needing these can be converted to the qdev device API too. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/versatile_pci.c')
-rw-r--r--hw/versatile_pci.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/versatile_pci.c b/hw/versatile_pci.c
index e89add1be5..5eb26251a3 100644
--- a/hw/versatile_pci.c
+++ b/hw/versatile_pci.c
@@ -153,13 +153,18 @@ static void versatile_pci_host_init(PCIDevice *d)
d->config[0x0D] = 0x10; // latency_timer
}
+static PCIDeviceInfo versatile_pci_host_info = {
+ .qdev.name = "versatile_pci_host",
+ .qdev.size = sizeof(PCIDevice),
+ .init = versatile_pci_host_init,
+};
+
static void versatile_pci_register_devices(void)
{
sysbus_register_dev("versatile_pci", sizeof(PCIVPBState), pci_vpb_init);
sysbus_register_dev("realview_pci", sizeof(PCIVPBState),
pci_realview_init);
- pci_qdev_register("versatile_pci_host", sizeof(PCIDevice),
- versatile_pci_host_init);
+ pci_qdev_register(&versatile_pci_host_info);
}
device_init(versatile_pci_register_devices)