Patchwork [08/22] ne2000: change pci_dev to is_pci

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

Comments

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

Patch

diff --git a/hw/ne2000.c b/hw/ne2000.c
index 7ac4fd3..33477b6 100644
--- a/hw/ne2000.c
+++ b/hw/ne2000.c
@@ -142,7 +142,7 @@  typedef struct NE2000State {
     uint8_t mult[8]; /* multicast mask array */
     qemu_irq irq;
     int isa_io_base;
-    PCIDevice *pci_dev;
+    int is_pci;
     VLANClientState *vc;
     uint8_t macaddr[6];
     uint8_t mem[NE2000_MEM_SIZE];
@@ -654,8 +654,8 @@  static void ne2000_save(QEMUFile* f,void* opaque)
 	NE2000State* s = opaque;
         uint32_t tmp;

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

         qemu_put_8s(f, &s->rxcr);

@@ -689,8 +689,8 @@  static int ne2000_load(QEMUFile* f,void* opaque,int version_id)
         if (version_id > 3)
             return -EINVAL;

-        if (s->pci_dev && version_id >= 3) {
-            ret = pci_device_load(s->pci_dev, f);
+        if (s->is_pci && version_id >= 3) {
+            ret = pci_device_load(&s->dev, f);
             if (ret < 0)
                 return ret;
         }
@@ -813,7 +813,7 @@  static void pci_ne2000_init(PCIDevice *pci_dev)
     pci_register_bar(&s->dev, 0, 0x100,
                            PCI_ADDRESS_SPACE_IO, ne2000_map);
     s->irq = s->dev.irq[0];
-    s->pci_dev = &s->dev;
+    s->is_pci = 1;
     qdev_get_macaddr(&s->dev.qdev, s->macaddr);
     ne2000_reset(s);
     s->vc = qdev_get_vlan_client(&s->dev.qdev,