[PATCH v2 03/16] pcmcia: Use common pci_stop_and_remove_bus_device()
Bjorn Helgaas
bhelgaas at google.com
Fri Aug 17 19:36:00 EDT 2012
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 at google.com>
---
drivers/pcmcia/cardbus.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/pcmcia/cardbus.c b/drivers/pcmcia/cardbus.c
index 24caeaf..94f87b5 100644
--- a/drivers/pcmcia/cardbus.c
+++ b/drivers/pcmcia/cardbus.c
@@ -106,7 +106,10 @@ int __ref cb_alloc(struct pcmcia_socket *s)
void cb_free(struct pcmcia_socket *s)
{
struct pci_dev *bridge = s->cb_dev;
+ struct pci_bus *bus = bridge->subordinate;
+ struct pci_dev *dev, *tmp;
- if (bridge)
- pci_stop_and_remove_behind_bridge(bridge);
+ if (bus)
+ list_for_each_entry_safe(dev, tmp, &bus->devices, bus_list)
+ pci_stop_and_remove_bus_device(dev);
}
More information about the linux-pcmcia
mailing list