Skip to content

Commit

Permalink
piix4: QOMify
Browse files Browse the repository at this point in the history
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
gongleiarei authored and Michael Tokarev committed Jun 23, 2015
1 parent b7c6971 commit acff3e4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hw/isa/piix4.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit acff3e4

Please sign in to comment.