diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2012-08-17 18:49:04 +0200 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2012-08-22 19:31:20 +0200 |
commit | 0a140577316268b3263fd169d339188ad1636af3 (patch) | |
tree | 35fc228275fde995554bc69a304938bee3303bfb | |
parent | PCI: acpiphp: Use common pci_stop_and_remove_bus_device() (diff) | |
download | linux-0a140577316268b3263fd169d339188ad1636af3.tar.xz linux-0a140577316268b3263fd169d339188ad1636af3.zip |
pcmcia: Use common pci_stop_and_remove_bus_device()
Use pci_stop_and_remove_bus_device() like most other hotplug drivers
rather than the special-purpose "behind_bridge" variant. This just
means we have to iterate through all the devices downstream of the
bridge ourselves, which is the same thing pci_stop_behind_bridge()
did.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
-rw-r--r-- | drivers/pcmcia/cardbus.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c index 24caeaf50529..9d3ac998fc1f 100644 --- a/drivers/pcmcia/cardbus.c +++ b/drivers/pcmcia/cardbus.c @@ -105,8 +105,17 @@ int __ref cb_alloc(struct pcmcia_socket *s) */ void cb_free(struct pcmcia_socket *s) { - struct pci_dev *bridge = s->cb_dev; + struct pci_dev *bridge, *dev, *tmp; + struct pci_bus *bus; - if (bridge) - pci_stop_and_remove_behind_bridge(bridge); + bridge = s->cb_dev; + if (!bridge) + return; + + bus = bridge->subordinate; + if (!bus) + return; + + list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list) + pci_stop_and_remove_bus_device(dev); } |