return ENODEV;
}
- if (priv->bridge.pci == NULL) {
- read_bridge_info(priv);
+ if (!priv->bridge.pci) {
+ return ENODEV;
}
switch ((dev->device_class >> 8) & 0x0ff) {
break;
case 0x04:
+ if (priv->bridge.pci == NULL)
+ read_bridge_info(priv);
+ if (priv->header_type == 0x01) {
*primary_bus = priv->bridge.pci->primary_bus;
*secondary_bus = priv->bridge.pci->secondary_bus;
*subordinate_bus = priv->bridge.pci->subordinate_bus;
+ } else {
+ *primary_bus = dev->bus;
+ *secondary_bus = -1;
+ *subordinate_bus = -1;
+ }
break;
case 0x07:
+ if (priv->bridge.pcmcia == NULL)
+ read_bridge_info(priv);
+ if (priv->header_type == 0x02) {
*primary_bus = priv->bridge.pcmcia->primary_bus;
*secondary_bus = priv->bridge.pcmcia->card_bus;
*subordinate_bus = priv->bridge.pcmcia->subordinate_bus;
+ } else {
+ *primary_bus = dev->bus;
+ *secondary_bus = -1;
+ *subordinate_bus = -1;
+ }
break;
}