When dpt_i2o is loaded first, i2o being loaded would cause it to call
pci_device_disable, thus breaking dpt_i2o's use of the device. Based on
similar usage of pci_disable_device in other drivers.
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
struct i2o_controller *c;
int rc;
struct pci_dev *i960 = NULL;
+ int pci_dev_busy = 0;
printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n");
if ((rc = i2o_pci_alloc(c))) {
printk(KERN_ERR "%s: DMA / IO allocation for I2O controller "
" failed\n", c->name);
+ if (rc == -ENODEV)
+ pci_dev_busy = 1;
goto free_controller;
}
i2o_iop_free(c);
disable:
- pci_disable_device(pdev);
+ if (!pci_dev_busy)
+ pci_disable_device(pdev);
return rc;
}