We have an API function for this now.
Cc: Zhang Yanmin <yanmin.zhang@intel.com>
Cc: Greg KH <greg@kroah.com>
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
         * 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;
         * 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;