Make sure header_type is available in read_bridge_info.
authorIan Romanick <idr@us.ibm.com>
Tue, 27 Mar 2007 14:57:00 +0000 (07:57 -0700)
committerIan Romanick <idr@us.ibm.com>
Tue, 27 Mar 2007 15:02:00 +0000 (08:02 -0700)
src/common_bridge.c

index 68a535e..ec1eddd 100644 (file)
@@ -55,8 +55,17 @@ read_bridge_info( struct pci_device_private * priv )
 {
     uint8_t  buf[0x40];
     pciaddr_t bytes;
+    int err;
 
 
+    /* Make sure the device has been probed.  If not, header_type won't be
+     * set and the rest of this function will fail.
+     */
+    err = pci_device_probe(& priv->base);
+    if (err) {
+       return err;
+    }
+
     switch ( priv->header_type & 0x7f ) {
     case 0x00:
        break;