aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2015-05-12 17:27:09 +0800
committerGerd Hoffmann <kraxel@redhat.com>2015-05-19 11:40:01 +0200
commitd338bae33a76d02678ea706622dfcc26b8b8325c (patch)
treec16e57873f5eb53c6b95d5902fed4e7e47d75758 /hw
parent62bf3df432d93fa6eb0f355c460d6d784b7cbc1a (diff)
cirrus_vga: QOMify
QOMify pci-cirrus-vga like isa-cirrus-vga device. Signed-off-by: Gonglei <arei.gonglei@huawei.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/display/cirrus_vga.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 8765a7e1d0..5198037d82 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -235,6 +235,10 @@ typedef struct PCICirrusVGAState {
CirrusVGAState cirrus_vga;
} PCICirrusVGAState;
+#define TYPE_PCI_CIRRUS_VGA "cirrus-vga"
+#define PCI_CIRRUS_VGA(obj) \
+ OBJECT_CHECK(PCICirrusVGAState, (obj), TYPE_PCI_CIRRUS_VGA)
+
#define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga"
#define ISA_CIRRUS_VGA(obj) \
OBJECT_CHECK(ISACirrusVGAState, (obj), TYPE_ISA_CIRRUS_VGA)
@@ -3008,7 +3012,7 @@ static const TypeInfo isa_cirrus_vga_info = {
static void pci_cirrus_vga_realize(PCIDevice *dev, Error **errp)
{
- PCICirrusVGAState *d = DO_UPCAST(PCICirrusVGAState, dev, dev);
+ PCICirrusVGAState *d = PCI_CIRRUS_VGA(dev);
CirrusVGAState *s = &d->cirrus_vga;
PCIDeviceClass *pc = PCI_DEVICE_GET_CLASS(dev);
int16_t device_id = pc->device_id;
@@ -3070,7 +3074,7 @@ static void cirrus_vga_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo cirrus_vga_info = {
- .name = "cirrus-vga",
+ .name = TYPE_PCI_CIRRUS_VGA,
.parent = TYPE_PCI_DEVICE,
.instance_size = sizeof(PCICirrusVGAState),
.class_init = cirrus_vga_class_init,