summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorGonglei2015-05-13 02:43:24 +0200
committerMichael Tokarev2015-06-23 18:57:28 +0200
commitacff3e48b7e1ac18e034cc612346bdc38ad96ee1 (patch)
tree8f1be54b220aa23d927500af5b17f79483687e30 /hw
parentpiix: piix3 QOMify (diff)
downloadqemu-acff3e48b7e1ac18e034cc612346bdc38ad96ee1.tar.gz
qemu-acff3e48b7e1ac18e034cc612346bdc38ad96ee1.tar.xz
qemu-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')
-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,