Skip to content

Commit d697552

Browse files
committed
Merge branch 'pci/msi'
- Forward MSI-X error code in pci_alloc_irq_vectors_affinity() (Piotr Stankiewicz) * pci/msi: PCI/MSI: Forward MSI-X error code in pci_alloc_irq_vectors_affinity()
2 parents 0caa17f + 30ff3e8 commit d697552

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

drivers/pci/msi.c

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,8 +1191,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
11911191
struct irq_affinity *affd)
11921192
{
11931193
struct irq_affinity msi_default_affd = {0};
1194-
int msix_vecs = -ENOSPC;
1195-
int msi_vecs = -ENOSPC;
1194+
int nvecs = -ENOSPC;
11961195

11971196
if (flags & PCI_IRQ_AFFINITY) {
11981197
if (!affd)
@@ -1203,17 +1202,16 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
12031202
}
12041203

12051204
if (flags & PCI_IRQ_MSIX) {
1206-
msix_vecs = __pci_enable_msix_range(dev, NULL, min_vecs,
1207-
max_vecs, affd, flags);
1208-
if (msix_vecs > 0)
1209-
return msix_vecs;
1205+
nvecs = __pci_enable_msix_range(dev, NULL, min_vecs, max_vecs,
1206+
affd, flags);
1207+
if (nvecs > 0)
1208+
return nvecs;
12101209
}
12111210

12121211
if (flags & PCI_IRQ_MSI) {
1213-
msi_vecs = __pci_enable_msi_range(dev, min_vecs, max_vecs,
1214-
affd);
1215-
if (msi_vecs > 0)
1216-
return msi_vecs;
1212+
nvecs = __pci_enable_msi_range(dev, min_vecs, max_vecs, affd);
1213+
if (nvecs > 0)
1214+
return nvecs;
12171215
}
12181216

12191217
/* use legacy IRQ if allowed */
@@ -1231,9 +1229,7 @@ int pci_alloc_irq_vectors_affinity(struct pci_dev *dev, unsigned int min_vecs,
12311229
}
12321230
}
12331231

1234-
if (msix_vecs == -ENOSPC)
1235-
return -ENOSPC;
1236-
return msi_vecs;
1232+
return nvecs;
12371233
}
12381234
EXPORT_SYMBOL(pci_alloc_irq_vectors_affinity);
12391235

0 commit comments

Comments
 (0)