=== modified file 'grub-core/bus/pci.c'
--- grub-core/bus/pci.c	2010-06-30 00:30:05 +0000
+++ grub-core/bus/pci.c	2011-01-02 17:31:32 +0000
@@ -20,6 +20,7 @@
 #include <grub/dl.h>
 #include <grub/pci.h>
 #include <grub/mm.h>
+#include <grub/misc.h>
 
 /* FIXME: correctly support 64-bit architectures.  */
 /* #if GRUB_TARGET_SIZEOF_VOID_P == 4 */
@@ -81,6 +82,8 @@ grub_pci_iterate (grub_pci_iteratefunc_t
 
   for (dev.bus = 0; dev.bus < GRUB_PCI_NUM_BUS; dev.bus++)
     {
+      grub_dprintf ("pci", "bus %x\n", dev.bus);
+
       for (dev.device = 0; dev.device < GRUB_PCI_NUM_DEVICES; dev.device++)
 	{
 	  for (dev.function = 0; dev.function < 8; dev.function++)
@@ -90,7 +93,14 @@ grub_pci_iterate (grub_pci_iteratefunc_t
 
 	      /* Check if there is a device present.  */
 	      if (id >> 16 == 0xFFFF)
-		continue;
+		{
+		  if (dev.function == 0)
+		    /* Devices are required to implement function 0, so if
+		       it's missing then there is no device here.  */
+		    break;
+		  else
+		    continue;
+		}
 
 #ifdef GRUB_MACHINE_MIPS_YEELOONG
 	      /* Skip ghosts.  */

