From 40021f08882aaef93c66c8c740087b6d3031b63a Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sun, 4 Dec 2011 12:22:06 -0600 Subject: pci: convert to QEMU Object Model Signed-off-by: Anthony Liguori --- hw/ide/via.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'hw/ide/via.c') diff --git a/hw/ide/via.c b/hw/ide/via.c index 4ea2064498..ef70864465 100644 --- a/hw/ide/via.c +++ b/hw/ide/via.c @@ -213,16 +213,23 @@ void vt82c686b_ide_init(PCIBus *bus, DriveInfo **hd_table, int devfn) pci_ide_create_devs(dev, hd_table); } -static PCIDeviceInfo via_ide_info = { - .qdev.name = "via-ide", - .qdev.size = sizeof(PCIIDEState), - .qdev.no_user = 1, - .init = vt82c686b_ide_initfn, - .exit = vt82c686b_ide_exitfn, - .vendor_id = PCI_VENDOR_ID_VIA, - .device_id = PCI_DEVICE_ID_VIA_IDE, - .revision = 0x06, - .class_id = PCI_CLASS_STORAGE_IDE, +static void via_ide_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->init = vt82c686b_ide_initfn; + k->exit = vt82c686b_ide_exitfn; + k->vendor_id = PCI_VENDOR_ID_VIA; + k->device_id = PCI_DEVICE_ID_VIA_IDE; + k->revision = 0x06; + k->class_id = PCI_CLASS_STORAGE_IDE; +} + +static DeviceInfo via_ide_info = { + .name = "via-ide", + .size = sizeof(PCIIDEState), + .no_user = 1, + .class_init = via_ide_class_init, }; static void via_ide_register(void) -- cgit v1.2.3