From: Andrew Morton We have an API function for this now. Cc: Zhang Yanmin Cc: Greg KH Cc: Bartlomiej Zolnierkiewicz Signed-off-by: Andrew Morton --- drivers/pci/search.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff -puN drivers/pci/search.c~use-no_pci_devices-in-pci-searchc drivers/pci/search.c --- a/drivers/pci/search.c~use-no_pci_devices-in-pci-searchc +++ a/drivers/pci/search.c @@ -199,7 +199,7 @@ static struct pci_dev * pci_find_subsys( * can cause some machines to crash. So here we detect and flag that * situation and bail out early. */ - if (unlikely(list_empty(&pci_devices))) + if (unlikely(no_pci_devices())) return NULL; down_read(&pci_bus_sem); n = from ? from->global_list.next : pci_devices.next; @@ -274,7 +274,7 @@ pci_get_subsys(unsigned int vendor, unsi * can cause some machines to crash. So here we detect and flag that * situation and bail out early. */ - if (unlikely(list_empty(&pci_devices))) + if (unlikely(no_pci_devices())) return NULL; down_read(&pci_bus_sem); n = from ? from->global_list.next : pci_devices.next; _