Patchwork cleanup pc_vga_init function

login
register
mail settings
Submitter Wanpeng Li
Date July 4, 2012, 8:56 a.m.
Message ID <1341392203-15766-1-git-send-email-liwp.linux@gmail.com>
Download mbox | patch
Permalink /patch/168928/
State New
Headers show

Comments

Wanpeng Li - July 4, 2012, 8:56 a.m.
From: Wanpeng Li <liwp@linux.vnet.ibm.com>

Since function pc_vga_init doesn't need to return DeviceState any more, 
just cleanup.

Signed-off-by: Wanpneg Li <liwp.linux@gmail.com>

---
 hw/pc.c |   18 +++++++-----------
 hw/pc.h |    2 +-
 2 files changed, 8 insertions(+), 12 deletions(-)

Patch

diff --git a/hw/pc.c b/hw/pc.c
index c7e9ab3..f387448 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -1037,39 +1037,35 @@  qemu_irq *pc_allocate_cpu_irq(void)
     return qemu_allocate_irqs(pic_irq_request, NULL, 1);
 }
 
-DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)
+void pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)
 {
-    DeviceState *dev = NULL;
-
     if (cirrus_vga_enabled) {
         if (pci_bus) {
-            dev = pci_cirrus_vga_init(pci_bus);
+            pci_cirrus_vga_init(pci_bus);
         } else {
-            dev = &isa_create_simple(isa_bus, "isa-cirrus-vga")->qdev;
+            isa_create_simple(isa_bus, "isa-cirrus-vga");
         }
     } else if (vmsvga_enabled) {
         if (pci_bus) {
-            dev = pci_vmsvga_init(pci_bus);
+            pci_vmsvga_init(pci_bus);
         } else {
             fprintf(stderr, "%s: vmware_vga: no PCI bus\n", __FUNCTION__);
         }
 #ifdef CONFIG_SPICE
     } else if (qxl_enabled) {
         if (pci_bus) {
-            dev = &pci_create_simple(pci_bus, -1, "qxl-vga")->qdev;
+            pci_create_simple(pci_bus, -1, "qxl-vga");
         } else {
             fprintf(stderr, "%s: qxl: no PCI bus\n", __FUNCTION__);
         }
 #endif
     } else if (std_vga_enabled) {
         if (pci_bus) {
-            dev = pci_vga_init(pci_bus);
+            pci_vga_init(pci_bus);
         } else {
-            dev = isa_vga_init(isa_bus);
+            isa_vga_init(isa_bus);
         }
     }
-
-    return dev;
 }
 
 static void cpu_request_exit(void *opaque, int irq, int level)
diff --git a/hw/pc.h b/hw/pc.h
index 31ccb6f..616864e 100644
--- a/hw/pc.h
+++ b/hw/pc.h
@@ -115,7 +115,7 @@  void *pc_memory_init(MemoryRegion *system_memory,
                     MemoryRegion *rom_memory,
                     MemoryRegion **ram_memory);
 qemu_irq *pc_allocate_cpu_irq(void);
-DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
+void pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
 void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
                           ISADevice **rtc_state,
                           ISADevice **floppy,