diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-04 12:22:06 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-01-27 10:50:50 -0600 |
commit | 40021f08882aaef93c66c8c740087b6d3031b63a (patch) | |
tree | a0429c040df66503d807770a3b89da9a0c70d8ac /hw/ide/cmd646.c | |
parent | 6e4ec3f9bb32d6f41e4fb30b872d2b7b084bc9a9 (diff) |
pci: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ide/cmd646.c')
-rw-r--r-- | hw/ide/cmd646.c | 36 |
1 files changed, 22 insertions, 14 deletions
diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index 99e7e6f866..9c673bb12b 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -325,20 +325,28 @@ void pci_cmd646_ide_init(PCIBus *bus, DriveInfo **hd_table, pci_ide_create_devs(dev, hd_table); } -static PCIDeviceInfo cmd646_ide_info = { - .qdev.name = "cmd646-ide", - .qdev.size = sizeof(PCIIDEState), - .init = pci_cmd646_ide_initfn, - .exit = pci_cmd646_ide_exitfn, - .vendor_id = PCI_VENDOR_ID_CMD, - .device_id = PCI_DEVICE_ID_CMD_646, - /* IDE controller revision */ - .revision = 0x07, - .class_id = PCI_CLASS_STORAGE_IDE, - .qdev.props = (Property[]) { - DEFINE_PROP_UINT32("secondary", PCIIDEState, secondary, 0), - DEFINE_PROP_END_OF_LIST(), - }, +static Property cmd646_ide_properties[] = { + DEFINE_PROP_UINT32("secondary", PCIIDEState, secondary, 0), + DEFINE_PROP_END_OF_LIST(), +}; + +static void cmd646_ide_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->init = pci_cmd646_ide_initfn; + k->exit = pci_cmd646_ide_exitfn; + k->vendor_id = PCI_VENDOR_ID_CMD; + k->device_id = PCI_DEVICE_ID_CMD_646; + k->revision = 0x07; + k->class_id = PCI_CLASS_STORAGE_IDE; +} + +static DeviceInfo cmd646_ide_info = { + .name = "cmd646-ide", + .size = sizeof(PCIIDEState), + .props = cmd646_ide_properties, + .class_init = cmd646_ide_class_init, }; static void cmd646_ide_register(void) |