Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19659
b: refs/heads/master
c: 15d8ec7
h: refs/heads/master
i:
  19657: 4d63732
  19655: eac5d5e
v: v3
  • Loading branch information
Markus Lidel authored and Linus Torvalds committed Feb 3, 2006
1 parent 007bcdc commit cbec939
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35dc8161d0a6fa5e654bcb3d6240acc9ecb0a259
refs/heads/master: 15d8ec7d08fbb7876e292b42bc92da8d82df7ea9
29 changes: 14 additions & 15 deletions trunk/drivers/message/i2o/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ static int __devinit i2o_pci_alloc(struct i2o_controller *c)
struct device *dev = &pdev->dev;
int i;

if (pci_request_regions(pdev, OSM_DESCRIPTION)) {
printk(KERN_ERR "%s: device already claimed\n", c->name);
return -ENODEV;
}

for (i = 0; i < 6; i++) {
/* Skip I/O spaces */
if (!(pci_resource_flags(pdev, i) & IORESOURCE_IO)) {
Expand Down Expand Up @@ -298,7 +303,7 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
struct i2o_controller *c;
int rc;
struct pci_dev *i960 = NULL;
int pci_dev_busy = 0;
int enabled = pdev->is_enabled;

printk(KERN_INFO "i2o: Checking for PCI I2O controllers...\n");

Expand All @@ -308,16 +313,12 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
return -ENODEV;
}

if ((rc = pci_enable_device(pdev))) {
printk(KERN_WARNING "i2o: couldn't enable device %s\n",
pci_name(pdev));
return rc;
}

if (pci_request_regions(pdev, OSM_DESCRIPTION)) {
printk(KERN_ERR "i2o: device already claimed\n");
return -ENODEV;
}
if (!enabled)
if ((rc = pci_enable_device(pdev))) {
printk(KERN_WARNING "i2o: couldn't enable device %s\n",
pci_name(pdev));
return rc;
}

if (pci_set_dma_mask(pdev, DMA_32BIT_MASK)) {
printk(KERN_WARNING "i2o: no suitable DMA found for %s\n",
Expand Down Expand Up @@ -395,9 +396,7 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,

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;
"failed\n", c->name);
goto free_controller;
}

Expand Down Expand Up @@ -425,7 +424,7 @@ static int __devinit i2o_pci_probe(struct pci_dev *pdev,
i2o_iop_free(c);

disable:
if (!pci_dev_busy)
if (!enabled)
pci_disable_device(pdev);

return rc;
Expand Down

0 comments on commit cbec939

Please sign in to comment.