summaryrefslogtreecommitdiff
path: root/src/common_bridge.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2011-02-13 17:49:49 +0100
committerMatthieu Herrb <matthieu.herrb@laas.fr>2011-02-13 17:49:49 +0100
commit7439067eb47086a1247e321183ebf59964e7a124 (patch)
tree9d21c8f674cabfccac13820e60eff814c66782b8 /src/common_bridge.c
parent59b24d7ef922ce0bac166f240e1788201ff573ff (diff)
parentf3e283a25f5fca4f750bb9538d69c4f36641cca5 (diff)
Merge remote branch 'origin/master' into obsd
Diffstat (limited to 'src/common_bridge.c')
-rw-r--r--src/common_bridge.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/common_bridge.c b/src/common_bridge.c
index f37420f..871c1f6 100644
--- a/src/common_bridge.c
+++ b/src/common_bridge.c
@@ -270,10 +270,6 @@ pci_device_get_bridge_buses(struct pci_device * dev, int *primary_bus,
return ENODEV;
}
- if (!priv->bridge.pci) {
- return ENODEV;
- }
-
switch ((dev->device_class >> 8) & 0x0ff) {
case 0x00:
/* What to do for host bridges? I'm pretty sure this isn't right.
@@ -294,7 +290,7 @@ pci_device_get_bridge_buses(struct pci_device * dev, int *primary_bus,
case 0x04:
if (priv->bridge.pci == NULL)
read_bridge_info(priv);
- if (priv->header_type == 0x01) {
+ if ((priv->header_type & 0x7f) == 0x01) {
*primary_bus = priv->bridge.pci->primary_bus;
*secondary_bus = priv->bridge.pci->secondary_bus;
*subordinate_bus = priv->bridge.pci->subordinate_bus;
@@ -308,7 +304,7 @@ pci_device_get_bridge_buses(struct pci_device * dev, int *primary_bus,
case 0x07:
if (priv->bridge.pcmcia == NULL)
read_bridge_info(priv);
- if (priv->header_type == 0x02) {
+ if ((priv->header_type & 0x7f) == 0x02) {
*primary_bus = priv->bridge.pcmcia->primary_bus;
*secondary_bus = priv->bridge.pcmcia->card_bus;
*subordinate_bus = priv->bridge.pcmcia->subordinate_bus;