aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorTrent Piepho <xyzzy@speakeasy.org>2009-03-20 16:56:00 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2009-03-20 17:56:45 -0400
commit90bdb3117f4209baa6d712b126f0e7791b24dc3f (patch)
tree5c2ca7ae062bc8aef2ce0ceb7f49e78b0329fb8a /drivers/pci/probe.c
parent79af72d716cf1bb13b175429cf181a6c4d063ee8 (diff)
PCI: don't scan existing devices
pci_scan_single_device is supposed to add newly discovered devices to pci_bus->devices, but doesn't check to see if the device has already been added. This can cause problems if we ever want to use this interface to rescan the PCI bus. If the device is already added, just return it. Signed-off-by: Trent Piepho <xyzzy@speakeasy.org> Signed-off-by: Alex Chiang <achiang@hp.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 943c49a7842c..140b9deb482c 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -1019,6 +1019,12 @@ struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn)
1019{ 1019{
1020 struct pci_dev *dev; 1020 struct pci_dev *dev;
1021 1021
1022 dev = pci_get_slot(bus, devfn);
1023 if (dev) {
1024 pci_dev_put(dev);
1025 return dev;
1026 }
1027
1022 dev = pci_scan_device(bus, devfn); 1028 dev = pci_scan_device(bus, devfn);
1023 if (!dev) 1029 if (!dev)
1024 return NULL; 1030 return NULL;