Patchwork [19/22] cirrus_vga: change use of pci_dev for is_pci

login
register
mail settings
Submitter Juan Quintela
Date Aug. 24, 2009, 11:03 a.m.
Message ID <a19e828c842885db4484d4b849561936ab99a0fe.1251111439.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/31920/
State Superseded
Headers show

Comments

Juan Quintela - Aug. 24, 2009, 11:03 a.m.
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 hw/cirrus_vga.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

Patch

diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
index a40f300..93cc1ff 100644
--- a/hw/cirrus_vga.c
+++ b/hw/cirrus_vga.c
@@ -241,6 +241,7 @@  typedef struct CirrusVGAState {
     PCIDevice dev;
     VGACommonState vga;

+    int is_pci;
     int cirrus_linear_io_addr;
     int cirrus_linear_bitblt_io_addr;
     int cirrus_mmio_io_addr;
@@ -3017,8 +3018,8 @@  static void cirrus_vga_save(QEMUFile *f, void *opaque)
 {
     CirrusVGAState *s = opaque;

-    if (s->vga.pci_dev)
-        pci_device_save(s->vga.pci_dev, f);
+    if (s->is_pci)
+        pci_device_save(&s->dev, f);

     qemu_put_be32s(f, &s->vga.latch);
     qemu_put_8s(f, &s->vga.sr_index);
@@ -3063,8 +3064,8 @@  static int cirrus_vga_load(QEMUFile *f, void *opaque, int version_id)
     if (version_id > 2)
         return -EINVAL;

-    if (s->vga.pci_dev && version_id >= 2) {
-        ret = pci_device_load(s->vga.pci_dev, f);
+    if (s->is_pci && version_id >= 2) {
+        ret = pci_device_load(&s->dev, f);
         if (ret < 0)
             return ret;
     }
@@ -3306,7 +3307,7 @@  static void pci_cirrus_vga_initfn(PCIDevice *dev)
      /* setup VGA */
      vga_common_init(&s->vga, VGA_RAM_SIZE);
      cirrus_init_common(s, device_id, 1);
-     s->vga.pci_dev = dev;
+     s->is_pci = 1;
      s->vga.ds = graphic_console_init(s->vga.update, s->vga.invalidate,
                                       s->vga.screen_dump, s->vga.text_update,
                                       &s->vga);