PCI: Short-circuit pci_device_is_present() for disconnected devices
authorKeith Busch <keith.busch@intel.com>
Thu, 30 Mar 2017 03:49:17 +0000 (22:49 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Thu, 30 Mar 2017 03:55:16 +0000 (22:55 -0500)
commitfe2bd75b2290bf6acd4b91312697e445668dd773
tree2292b23906bd7d205c3f79a877d1b839a6bc4bf5
parent0170591bb06788034ae72bfa56e42f283ab3de5a
PCI: Short-circuit pci_device_is_present() for disconnected devices

If the PCI device is disconnected, return false immediately from
pci_device_is_present().  pci_device_is_present() uses the bus accessors,
so the early return in the device accessors doesn't help here.

Tested-by: Krishna Dhulipala <krishnad@fb.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Wei Zhang <wzhang@fb.com>
drivers/pci/pci.c