Commit 70308923 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 1ba6ab11
...@@ -22,16 +22,27 @@ EXPORT_SYMBOL(pci_root_buses); ...@@ -22,16 +22,27 @@ EXPORT_SYMBOL(pci_root_buses);
LIST_HEAD(pci_devices); LIST_HEAD(pci_devices);
static int find_anything(struct device *dev, void *data)
{
return 1;
}
/* /*
* Some device drivers need know if pci is initiated. * Some device drivers need know if pci is initiated.
* Basically, we think pci is not initiated when there * 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) 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); EXPORT_SYMBOL(no_pci_devices);
#ifdef HAVE_PCI_LEGACY #ifdef HAVE_PCI_LEGACY
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment