Messages in this thread | | | Date | Tue, 14 May 2013 11:56:23 -0700 | Subject | Re: [RFC PATCH v2, part 2 01/18] PCI: introduce hotplug-safe PCI bus iterators | From | Yinghai Lu <> |
| |
On Tue, May 14, 2013 at 9:51 AM, Jiang Liu <liuj97@gmail.com> wrote: > Introduce hotplug-safe PCI bus iterators as below, which hold a > reference on the returned PCI bus object. > bool pci_bus_exists(int domain, int busnr); > struct pci_bus *pci_get_bus(int domain, int busnr); > struct pci_bus *pci_get_next_bus(struct pci_bus *from); > struct pci_bus *pci_get_next_root_bus(struct pci_bus *from); > #define for_each_pci_bus(b) for (b = NULL; (b = pci_get_next_bus(b)); ) > #define for_each_pci_root_bus(b) \ > for (b = NULL; (b = pci_get_next_root_bus(b)); ) > > The long-term goal is to remove hotplug-unsafe pci_find_bus(), > pci_find_next_bus() and the global pci_root_buses list. > > These new interfaces may be a littler slower than existing interfaces, > but it should be acceptable because they are not used on hot paths. > > Signed-off-by: Jiang Liu <jiang.liu@huawei.com> > Cc: linux-pci@vger.kernel.org > Cc: linux-kernel@vger.kernel.org
Acked-by: Yinghai Lu <yinghai@kernel.org>
| |