summaryrefslogtreecommitdiff
path: root/hw/isa
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2015-05-13 08:43:24 +0800
committerMichael Tokarev <mjt@tls.msk.ru>2015-06-23 19:57:28 +0300
commitacff3e48b7e1ac18e034cc612346bdc38ad96ee1 (patch)
tree8f1be54b220aa23d927500af5b17f79483687e30 /hw/isa
parentb7c69719d21bea305b7cff6ecde0974edc5ff4b8 (diff)
downloadqemu-acff3e48b7e1ac18e034cc612346bdc38ad96ee1.zip
piix4: QOMify
Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'hw/isa')
-rw-r--r--hw/isa/piix4.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/isa/piix4.c b/hw/isa/piix4.c
index d9522b1f45..2c59e91fff 100644
--- a/hw/isa/piix4.c
+++ b/hw/isa/piix4.c
@@ -34,6 +34,10 @@ typedef struct PIIX4State {
PCIDevice dev;
} PIIX4State;
+#define TYPE_PIIX4_PCI_DEVICE "PIIX4"
+#define PIIX4_PCI_DEVICE(obj) \
+ OBJECT_CHECK(PIIX4State, (obj), TYPE_PIIX4_PCI_DEVICE)
+
static void piix4_reset(void *opaque)
{
PIIX4State *d = opaque;
@@ -84,7 +88,7 @@ static const VMStateDescription vmstate_piix4 = {
static void piix4_realize(PCIDevice *dev, Error **errp)
{
- PIIX4State *d = DO_UPCAST(PIIX4State, dev, dev);
+ PIIX4State *d = PIIX4_PCI_DEVICE(dev);
isa_bus_new(DEVICE(d), pci_address_space(dev),
pci_address_space_io(dev));
@@ -121,7 +125,7 @@ static void piix4_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo piix4_info = {
- .name = "PIIX4",
+ .name = TYPE_PIIX4_PCI_DEVICE,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PIIX4State),
.class_init = piix4_class_init,