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/wdt_i6300esb.c | |
parent | 6e4ec3f9bb32d6f41e4fb30b872d2b7b084bc9a9 (diff) | |
download | qemu-40021f08882aaef93c66c8c740087b6d3031b63a.zip qemu-40021f08882aaef93c66c8c740087b6d3031b63a.tar.gz qemu-40021f08882aaef93c66c8c740087b6d3031b63a.tar.bz2 |
pci: convert to QEMU Object Model
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/wdt_i6300esb.c')
-rw-r--r-- | hw/wdt_i6300esb.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/hw/wdt_i6300esb.c b/hw/wdt_i6300esb.c index 20d8673..a6ceff8 100644 --- a/hw/wdt_i6300esb.c +++ b/hw/wdt_i6300esb.c @@ -143,7 +143,7 @@ static void i6300esb_disable_timer(I6300State *d) static void i6300esb_reset(DeviceState *dev) { - PCIDevice *pdev = DO_UPCAST(PCIDevice, qdev, dev); + PCIDevice *pdev = PCI_DEVICE(dev); I6300State *d = DO_UPCAST(I6300State, dev, pdev); i6300esb_debug("I6300State = %p\n", d); @@ -425,18 +425,25 @@ static WatchdogTimerModel model = { .wdt_description = "Intel 6300ESB", }; -static PCIDeviceInfo i6300esb_info = { - .qdev.name = "i6300esb", - .qdev.size = sizeof(I6300State), - .qdev.vmsd = &vmstate_i6300esb, - .qdev.reset = i6300esb_reset, - .config_read = i6300esb_config_read, - .config_write = i6300esb_config_write, - .init = i6300esb_init, - .exit = i6300esb_exit, - .vendor_id = PCI_VENDOR_ID_INTEL, - .device_id = PCI_DEVICE_ID_INTEL_ESB_9, - .class_id = PCI_CLASS_SYSTEM_OTHER, +static void i6300esb_class_init(ObjectClass *klass, void *data) +{ + PCIDeviceClass *k = PCI_DEVICE_CLASS(klass); + + k->config_read = i6300esb_config_read; + k->config_write = i6300esb_config_write; + k->init = i6300esb_init; + k->exit = i6300esb_exit; + k->vendor_id = PCI_VENDOR_ID_INTEL; + k->device_id = PCI_DEVICE_ID_INTEL_ESB_9; + k->class_id = PCI_CLASS_SYSTEM_OTHER; +} + +static DeviceInfo i6300esb_info = { + .name = "i6300esb", + .size = sizeof(I6300State), + .vmsd = &vmstate_i6300esb, + .reset = i6300esb_reset, + .class_init = i6300esb_class_init, }; static void i6300esb_register_devices(void) |