bacd9b0
From 4f9f83c8b0a26a24ab2963e57a375b0ba99638f1 Mon Sep 17 00:00:00 2001
9e0a867
From: Paolo Bonzini <pbonzini@redhat.com>
9e0a867
Date: Thu, 2 May 2013 11:38:37 +0200
9e0a867
Subject: [PATCH] pci: do not export pci_bus_reset
9e0a867
9e0a867
qbus_reset_all can be used instead.  There is no semantic change
9e0a867
because pcibus_reset returns 1 and takes care of the device
9e0a867
tree traversal.
9e0a867
9e0a867
This will be necessary once the traversal is done always in
9e0a867
qbus_reset_all *before* invoking pcibus_reset itself.
9e0a867
9e0a867
Tested-by: Claudio Bley <cbley@av-test.de>
9e0a867
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
9e0a867
---
9e0a867
 hw/pci/pci.c         | 8 ++------
9e0a867
 hw/pci/pci_bridge.c  | 2 +-
9e0a867
 include/hw/pci/pci.h | 1 -
9e0a867
 3 files changed, 3 insertions(+), 8 deletions(-)
9e0a867
9e0a867
diff --git a/hw/pci/pci.c b/hw/pci/pci.c
bacd9b0
index 49eca95..504ed9d 100644
9e0a867
--- a/hw/pci/pci.c
9e0a867
+++ b/hw/pci/pci.c
bacd9b0
@@ -212,8 +212,9 @@ void pci_device_reset(PCIDevice *dev)
9e0a867
  * Trigger pci bus reset under a given bus.
9e0a867
  * To be called on RST# assert.
9e0a867
  */
9e0a867
-void pci_bus_reset(PCIBus *bus)
9e0a867
+static int pcibus_reset(BusState *qbus)
9e0a867
 {
9e0a867
+    PCIBus *bus = DO_UPCAST(PCIBus, qbus, qbus);
9e0a867
     int i;
9e0a867
 
9e0a867
     for (i = 0; i < bus->nirq; i++) {
bacd9b0
@@ -224,11 +225,6 @@ void pci_bus_reset(PCIBus *bus)
9e0a867
             pci_device_reset(bus->devices[i]);
9e0a867
         }
9e0a867
     }
9e0a867
-}
9e0a867
-
9e0a867
-static int pcibus_reset(BusState *qbus)
9e0a867
-{
9e0a867
-    pci_bus_reset(DO_UPCAST(PCIBus, qbus, qbus));
9e0a867
 
9e0a867
     /* topology traverse is done by pci_bus_reset().
9e0a867
        Tell qbus/qdev walker not to traverse the tree */
9e0a867
diff --git a/hw/pci/pci_bridge.c b/hw/pci/pci_bridge.c
45bdef1
index 290abab..41d8755 100644
9e0a867
--- a/hw/pci/pci_bridge.c
9e0a867
+++ b/hw/pci/pci_bridge.c
9e0a867
@@ -268,7 +268,7 @@ void pci_bridge_write_config(PCIDevice *d,
9e0a867
     newctl = pci_get_word(d->config + PCI_BRIDGE_CONTROL);
9e0a867
     if (~oldctl & newctl & PCI_BRIDGE_CTL_BUS_RESET) {
9e0a867
         /* Trigger hot reset on 0->1 transition. */
9e0a867
-        pci_bus_reset(&s->sec_bus);
9e0a867
+        qbus_reset_all(&s->sec_bus.qbus);
9e0a867
     }
9e0a867
 }
9e0a867
 
9e0a867
diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h
45bdef1
index b783e68..754b82d 100644
9e0a867
--- a/include/hw/pci/pci.h
9e0a867
+++ b/include/hw/pci/pci.h
45bdef1
@@ -373,7 +373,6 @@ void pci_bus_fire_intx_routing_notifier(PCIBus *bus);
9e0a867
 void pci_device_set_intx_routing_notifier(PCIDevice *dev,
9e0a867
                                           PCIINTxRoutingNotifier notifier);
9e0a867
 void pci_device_reset(PCIDevice *dev);
9e0a867
-void pci_bus_reset(PCIBus *bus);
9e0a867
 
9e0a867
 PCIDevice *pci_nic_init(NICInfo *nd, PCIBus *rootbus,
9e0a867
                         const char *default_model,