Commit 948b7620 authored by Dennis Chen's avatar Dennis Chen Committed by Bjorn Helgaas

PCI/MSI: Return -ENOSPC if pci_enable_msi_range() can't get enough vectors

If device doesn't support as many MSI vectors as the driver requested, we
previously returned -EINVAL from __pci_enable_msi_range() and
pci_enable_msi_range().  In other similar situations in both
__pci_enable_msi_range() and __pci_enable_msix_range(), we returned
-ENOSPC.

Return -ENOSPC from __pci_enable_msi_range() so we do it consistently.

[bhelgaas: changelog]
Signed-off-by: default avatarDennis Chen <dennis.chen@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
CC: Tejun Heo <tj@kernel.org>
CC: Christoph Hellwig <hch@lst.de>
CC: Tom Long Nguyen <tom.l.nguyen@intel.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: Marc Zyngier <marc.zyngier@arm.com>
CC: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
CC: Steve Capper <steve.capper@arm.com>
parent 3674cc49
......@@ -1065,7 +1065,7 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
if (nvec < 0)
return nvec;
if (nvec < minvec)
return -EINVAL;
return -ENOSPC;
if (nvec > maxvec)
nvec = maxvec;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment