From 0aab0d3a4a62505ab7e79ee0a67fe3f04f6dae23 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 30 Jun 2009 14:12:07 +0200 Subject: 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 --- hw/versatile_pci.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'hw/versatile_pci.c') 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) -- cgit v1.2.1