summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@us.ibm.com>2007-03-27 07:57:00 -0700
committerIan Romanick <idr@us.ibm.com>2007-03-27 08:02:00 -0700
commit28dc34c2a6045ab95183d708500009bd1eea1659 (patch)
tree3813221b6429be021ebe52da002f0b1c29fdc599
parent061a011ceffc13db3b147dd105d8b7c2edcc3bc8 (diff)
Make sure header_type is available in read_bridge_info.
-rw-r--r--src/common_bridge.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common_bridge.c b/src/common_bridge.c
index 68a535e..ec1eddd 100644
--- a/src/common_bridge.c
+++ b/src/common_bridge.c
@@ -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;