summaryrefslogtreecommitdiffstats
path: root/drivers/pci/search.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bhelgaas@google.com>2012-08-17 15:53:27 -0600
committerBjorn Helgaas <bhelgaas@google.com>2012-08-22 11:31:37 -0600
commit66455f5472383df3632140e04f0852215e5c9ce8 (patch)
tree647bff405ef4cbdd01b1dba594e632b715029e54 /drivers/pci/search.c
parent125e14bb35e65b1ddfb7252fa8f6e3c50dbb6db2 (diff)
downloadop-kernel-dev-66455f5472383df3632140e04f0852215e5c9ce8.zip
op-kernel-dev-66455f5472383df3632140e04f0852215e5c9ce8.tar.gz
PCI: Use list_for_each_entry() for bus->devices traversal
Replace list_for_each() + pci_dev_b() with the simpler list_for_each_entry(). Tested-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Yinghai Lu <yinghai@kernel.org>
Diffstat (limited to 'drivers/pci/search.c')
-rw-r--r--drivers/pci/search.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pci/search.c b/drivers/pci/search.c
index 993d4a0..f56b237 100644
--- a/drivers/pci/search.c
+++ b/drivers/pci/search.c
@@ -130,16 +130,14 @@ pci_find_next_bus(const struct pci_bus *from)
* decrement the reference count by calling pci_dev_put().
* If no device is found, %NULL is returned.
*/
-struct pci_dev * pci_get_slot(struct pci_bus *bus, unsigned int devfn)
+struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn)
{
- struct list_head *tmp;
struct pci_dev *dev;
WARN_ON(in_interrupt());
down_read(&pci_bus_sem);
- list_for_each(tmp, &bus->devices) {
- dev = pci_dev_b(tmp);
+ list_for_each_entry(dev, &bus->devices, bus_list) {
if (dev->devfn == devfn)
goto out;
}
OpenPOWER on IntegriCloud