[PATCH v2 03/16] pcmcia: Use common pci_stop_and_remove_bus_device()

Yinghai Lu yinghai at kernel.org
Fri Aug 17 20:58:58 EDT 2012


On Fri, Aug 17, 2012 at 4:36 PM, Bjorn Helgaas <bhelgaas at google.com> wrote:
> 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);
>  }
>

original looks like bridge could be NULL.

Yinghai



More information about the linux-pcmcia mailing list