linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: linux-pci@vger.kernel.org, linux-pcmcia@lists.infradead.org,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Subject: Re: [PATCH v2 03/16] pcmcia: Use common pci_stop_and_remove_bus_device()
Date: Fri, 17 Aug 2012 17:58:58 -0700	[thread overview]
Message-ID: <CAE9FiQXFObwPx50NprfnEUyO5PcppUdxqOKg_3eetf-W7a8+FA@mail.gmail.com> (raw)
In-Reply-To: <20120817233600.10973.11841.stgit@bhelgaas.mtv.corp.google.com>

On Fri, Aug 17, 2012 at 4:36 PM, Bjorn Helgaas <bhelgaas@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@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

  reply	other threads:[~2012-08-18  0:59 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17 23:35 [PATCH v2 00/16] Clean up drivers/pci/remove.c Bjorn Helgaas
2012-08-17 23:35 ` [PATCH v2 01/16] PCI: acpiphp: Stop disabling bridges on remove Bjorn Helgaas
2012-08-17 23:35 ` [PATCH v2 02/16] PCI: acpiphp: Use common pci_stop_and_remove_bus_device() Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 03/16] pcmcia: " Bjorn Helgaas
2012-08-18  0:58   ` Yinghai Lu [this message]
2012-08-20 14:46     ` Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 04/16] PCI: Don't export stop_bus_device and remove_bus_device interfaces Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 05/16] PCI: Remove pci_stop_and_remove_behind_bridge() Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 06/16] PCI: Use list_for_each_entry() for bus->devices traversal Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 07/16] PCI: Fold stop and remove helpers into their callers Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 08/16] PCI: Stop and remove devices in one pass Bjorn Helgaas
2012-08-18  1:21   ` Yinghai Lu
2012-08-20 15:27     ` Bjorn Helgaas
2012-08-21  5:39       ` Yinghai Lu
2012-08-22 17:40         ` Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 09/16] PCI: Remove unused, commented-out, code Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 10/16] PCI: Rename local variables to conventional names Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 11/16] PCI: Leave normal LIST_POISON in deleted list entries Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 12/16] frv/PCI: Use list_for_each_entry() for bus->devices traversal Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 13/16] parisc/PCI: Enable PERR/SERR on all devices Bjorn Helgaas
2012-08-17 23:36 ` [PATCH v2 14/16] parisc/PCI: Use list_for_each_entry() for bus->devices traversal Bjorn Helgaas
2012-08-17 23:37 ` [PATCH v2 15/16] sgi-agp: " Bjorn Helgaas
2012-08-17 23:37 ` [PATCH v2 16/16] PCI: Remove unused pci_dev_b() Bjorn Helgaas
2012-08-20  4:58 ` [PATCH v2 00/16] Clean up drivers/pci/remove.c Yijing Wang
2012-08-20 15:40   ` Bjorn Helgaas
2012-08-21  3:45     ` Yijing Wang
2012-08-22 17:26       ` Bjorn Helgaas
2012-08-24 21:25 ` Bjorn Helgaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAE9FiQXFObwPx50NprfnEUyO5PcppUdxqOKg_3eetf-W7a8+FA@mail.gmail.com \
    --to=yinghai@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-pcmcia@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).