OSDN Git Service

PCI: cpcihp: Iterate over all devices in slot, not functions 0-7
authorYijing Wang <wangyijing@huawei.com>
Tue, 15 Jan 2013 03:12:20 +0000 (11:12 +0800)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 25 Jan 2013 16:23:08 +0000 (09:23 -0700)
commit05b1250048158684a9fc95da5904e12cd6beefd3
treec375492175e413b5462f2dc484ec96456d00f7f8
parentba518e3c177547dfebf7fa7252cea0c850e7ce25
PCI: cpcihp: Iterate over all devices in slot, not functions 0-7

Iterate through devices in a slot by using the upstream bridge's
"bus->devices" list instead of assuming they are functions 0-7.  It's
possible there are several slots on the same pci_bus, so restrict it to
only devices matching this slot's device number.

ARI (which allows functions 0-255) is a PCIe-only feature, and this is
a PCI hotplug driver, so we shouldn't find anything other than functions
0-7, but it's better to iterate the same way as other hotplug drivers.

[bhelgaas: changelog, check PCI_SLOT, fix cpci_unconfigure_slot()]
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/hotplug/cpci_hotplug_pci.c