display/vmware_vga: QOM casting sweep
Define and use standard QOM cast macro. Remove usages of DO_UPCAST() and direct -> style casting. Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com> [AF: Renamed to TYPE_VMWARE_VGA and VMWARE_VGA()] Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
6d27a4099e
commit
39d4598763
|
@ -81,6 +81,11 @@ struct vmsvga_state_s {
|
||||||
int redraw_fifo_first, redraw_fifo_last;
|
int redraw_fifo_first, redraw_fifo_last;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define TYPE_VMWARE_SVGA "vmware-svga"
|
||||||
|
|
||||||
|
#define VMWARE_SVGA(obj) \
|
||||||
|
OBJECT_CHECK(struct pci_vmsvga_state_s, (obj), TYPE_VMWARE_SVGA)
|
||||||
|
|
||||||
struct pci_vmsvga_state_s {
|
struct pci_vmsvga_state_s {
|
||||||
PCIDevice card;
|
PCIDevice card;
|
||||||
struct vmsvga_state_s chip;
|
struct vmsvga_state_s chip;
|
||||||
|
@ -1092,8 +1097,7 @@ static void vmsvga_update_display(void *opaque)
|
||||||
|
|
||||||
static void vmsvga_reset(DeviceState *dev)
|
static void vmsvga_reset(DeviceState *dev)
|
||||||
{
|
{
|
||||||
struct pci_vmsvga_state_s *pci =
|
struct pci_vmsvga_state_s *pci = VMWARE_SVGA(dev);
|
||||||
DO_UPCAST(struct pci_vmsvga_state_s, card.qdev, dev);
|
|
||||||
struct vmsvga_state_s *s = &pci->chip;
|
struct vmsvga_state_s *s = &pci->chip;
|
||||||
|
|
||||||
s->index = 0;
|
s->index = 0;
|
||||||
|
@ -1250,8 +1254,7 @@ static const MemoryRegionOps vmsvga_io_ops = {
|
||||||
|
|
||||||
static int pci_vmsvga_initfn(PCIDevice *dev)
|
static int pci_vmsvga_initfn(PCIDevice *dev)
|
||||||
{
|
{
|
||||||
struct pci_vmsvga_state_s *s =
|
struct pci_vmsvga_state_s *s = VMWARE_SVGA(dev);
|
||||||
DO_UPCAST(struct pci_vmsvga_state_s, card, dev);
|
|
||||||
|
|
||||||
s->card.config[PCI_CACHE_LINE_SIZE] = 0x08; /* Cache line size */
|
s->card.config[PCI_CACHE_LINE_SIZE] = 0x08; /* Cache line size */
|
||||||
s->card.config[PCI_LATENCY_TIMER] = 0x40; /* Latency timer */
|
s->card.config[PCI_LATENCY_TIMER] = 0x40; /* Latency timer */
|
||||||
|
@ -1303,7 +1306,7 @@ static void vmsvga_class_init(ObjectClass *klass, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo vmsvga_info = {
|
static const TypeInfo vmsvga_info = {
|
||||||
.name = "vmware-svga",
|
.name = TYPE_VMWARE_SVGA,
|
||||||
.parent = TYPE_PCI_DEVICE,
|
.parent = TYPE_PCI_DEVICE,
|
||||||
.instance_size = sizeof(struct pci_vmsvga_state_s),
|
.instance_size = sizeof(struct pci_vmsvga_state_s),
|
||||||
.class_init = vmsvga_class_init,
|
.class_init = vmsvga_class_init,
|
||||||
|
|
Loading…
Reference in a new issue