mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
79af72d716
commit
90bdb3117f
|
@ -1019,6 +1019,12 @@ struct pci_dev *__ref pci_scan_single_device(struct pci_bus *bus, int devfn)
|
|||
{
|
||||
struct pci_dev *dev;
|
||||
|
||||
dev = pci_get_slot(bus, devfn);
|
||||
if (dev) {
|
||||
pci_dev_put(dev);
|
||||
return dev;
|
||||
}
|
||||
|
||||
dev = pci_scan_device(bus, devfn);
|
||||
if (!dev)
|
||||
return NULL;
|
||||
|
|
Loading…
Reference in New Issue