[gPXE-devel] [PATCH 30/33] [pci] Skip devices for which pci_read_config fails

Piotr Jaroszyński p.jaroszynski at gmail.com
Sun Aug 15 18:59:35 EDT 2010


At least the linux implementaion of the PCI API returns an error for
devices which weren't explicitly enabled. Skip them.

Signed-off-by: Piotr Jaroszyński <p.jaroszynski at gmail.com>
---
 src/drivers/bus/pci.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/drivers/bus/pci.c b/src/drivers/bus/pci.c
index 085d15e..d6786ea 100644
--- a/src/drivers/bus/pci.c
+++ b/src/drivers/bus/pci.c
@@ -263,7 +263,8 @@ static int pcibus_probe ( struct root_device *rootdev ) {
 			}
 
 			/* Check for physical device presence */
-			pci_read_config_dword ( pci, PCI_VENDOR_ID, &tmp );
+			if ( pci_read_config_dword ( pci, PCI_VENDOR_ID, &tmp ) )
+				continue;
 			if ( ( tmp == 0xffffffff ) || ( tmp == 0 ) )
 				continue;
 			
-- 
1.7.1



More information about the gPXE-devel mailing list