diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2008-02-14 01:30:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-04-21 00:46:59 -0400 |
commit | 70308923d317f2ad4973c30d90bb48ae38761317 (patch) | |
tree | b49daa7440e68c952e88617b3a36577d5c85a87b /drivers/pci | |
parent | 1ba6ab11d8fbd8d29afec4e39236e1255ae0339a (diff) |
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')
-rw-r--r-- | drivers/pci/probe.c | 17 |
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); | |||
22 | 22 | ||
23 | LIST_HEAD(pci_devices); | 23 | LIST_HEAD(pci_devices); |
24 | 24 | ||
25 | |||
26 | static int find_anything(struct device *dev, void *data) | ||
27 | { | ||
28 | return 1; | ||
29 | } | ||
30 | |||
25 | /* | 31 | /* |
26 | * Some device drivers need know if pci is initiated. | 32 | * Some device drivers need know if pci is initiated. |
27 | * Basically, we think pci is not initiated when there | 33 | * Basically, we think pci is not initiated when there |
28 | * is no device in list of pci_devices. | 34 | * is no device to be found on the pci_bus_type. |
29 | */ | 35 | */ |
30 | int no_pci_devices(void) | 36 | int no_pci_devices(void) |
31 | { | 37 | { |
32 | return list_empty(&pci_devices); | 38 | struct device *dev; |
33 | } | 39 | int no_devices; |
34 | 40 | ||
41 | dev = bus_find_device(&pci_bus_type, NULL, NULL, find_anything); | ||
42 | no_devices = (dev == NULL); | ||
43 | put_device(dev); | ||
44 | return no_devices; | ||
45 | } | ||
35 | EXPORT_SYMBOL(no_pci_devices); | 46 | EXPORT_SYMBOL(no_pci_devices); |
36 | 47 | ||
37 | #ifdef HAVE_PCI_LEGACY | 48 | #ifdef HAVE_PCI_LEGACY |