Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139334
b: refs/heads/master
c: b5fbf53
h: refs/heads/master
v: v3
  • Loading branch information
Michael Ellerman authored and Jesse Barnes committed Mar 20, 2009
1 parent d5942d1 commit 3c34c24
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 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: 35e1801ea637810830e653ffe7ff62c7048ae03a
refs/heads/master: b5fbf53324f65646154e172af350674d5a2a1629
21 changes: 12 additions & 9 deletions trunk/drivers/pci/msi.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)

list_for_each_entry(entry, &dev->msi_list, list) {
ret = arch_setup_msi_irq(dev, entry);
if (ret)
if (ret < 0)
return ret;
if (ret > 0)
return -ENOSPC;
}

return 0;
Expand Down Expand Up @@ -487,22 +489,23 @@ static int msix_capability_init(struct pci_dev *dev,
}

ret = arch_setup_msi_irqs(dev, nvec, PCI_CAP_ID_MSIX);
if (ret) {
if (ret < 0) {
/* If we had some success report the number of irqs
* we succeeded in setting up. */
int avail = 0;
list_for_each_entry(entry, &dev->msi_list, list) {
if (entry->irq != 0) {
avail++;
}
}

msi_free_irqs(dev);
if (avail != 0)
ret = avail;
}

/* If we had some success report the number of irqs
* we succeeded in setting up.
*/
if (avail == 0)
avail = ret;
return avail;
if (ret) {
msi_free_irqs(dev);
return ret;
}

i = 0;
Expand Down

0 comments on commit 3c34c24

Please sign in to comment.