summaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2008-02-14 07:30:39 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2008-04-21 06:46:59 +0200
commit70308923d317f2ad4973c30d90bb48ae38761317 (patch)
treeb49daa7440e68c952e88617b3a36577d5c85a87b /drivers/pci/probe.c
parentPCI: remove initial bios sort of PCI devices on x86 (diff)
downloadlinux-70308923d317f2ad4973c30d90bb48ae38761317.tar.xz
linux-70308923d317f2ad4973c30d90bb48ae38761317.zip
PCI: make no_pci_devices() use the pci_bus_type list
no_pci_devices() should use the driver core list of PCI devices, not our "separate" one. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 2db2e4bb0d1e..387fbbb97431 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -22,16 +22,27 @@ EXPORT_SYMBOL(pci_root_buses);
LIST_HEAD(pci_devices);
+
+static int find_anything(struct device *dev, void *data)
+{
+ return 1;
+}
+
/*
* Some device drivers need know if pci is initiated.
* Basically, we think pci is not initiated when there
- * is no device in list of pci_devices.
+ * is no device to be found on the pci_bus_type.
*/
int no_pci_devices(void)
{
- return list_empty(&pci_devices);
-}
+ struct device *dev;
+ int no_devices;
+ dev = bus_find_device(&pci_bus_type, NULL, NULL, find_anything);
+ no_devices = (dev == NULL);
+ put_device(dev);
+ return no_devices;
+}
EXPORT_SYMBOL(no_pci_devices);
#ifdef HAVE_PCI_LEGACY