From 266912b07aadc40f5950169c7a66885f4099a6f8 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 13 Feb 2008 22:30:39 -0800 Subject: [PATCH] --- yaml --- r: 91669 b: refs/heads/master c: 70308923d317f2ad4973c30d90bb48ae38761317 h: refs/heads/master i: 91667: de90bf94876350cbc1db1842b92ac739d5ceaaad v: v3 --- [refs] | 2 +- trunk/drivers/pci/probe.c | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index d841db25c10a..b5af96b2b7fd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 1ba6ab11d8fbd8d29afec4e39236e1255ae0339a +refs/heads/master: 70308923d317f2ad4973c30d90bb48ae38761317 diff --git a/trunk/drivers/pci/probe.c b/trunk/drivers/pci/probe.c index 2db2e4bb0d1e..387fbbb97431 100644 --- a/trunk/drivers/pci/probe.c +++ b/trunk/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