Patchwork [2/9] PCI/MSI/PPC: Make return values only 0/-errno when MSIs allocated

login
register
mail settings
Submitter Alexander Gordeev
Date Sept. 9, 2013, 3:22 p.m.
Message ID <20130909152252.GC24962@dhcp-26-207.brq.redhat.com>
Download mbox | patch
Permalink /patch/273587/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Alexander Gordeev - Sept. 9, 2013, 3:22 p.m.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 arch/powerpc/kernel/msi.c            |    2 +-
 arch/powerpc/platforms/pseries/msi.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Patch

diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
index 8bbc12d..36d70b9 100644
--- a/arch/powerpc/kernel/msi.c
+++ b/arch/powerpc/kernel/msi.c
@@ -22,7 +22,7 @@  int arch_msi_check_device(struct pci_dev* dev, int nvec, int type)
 
 	/* PowerPC doesn't support multiple MSI yet */
 	if (type == PCI_CAP_ID_MSI && nvec > 1)
-		return 1;
+		return -EINVAL;
 
 	if (ppc_md.msi_check_device) {
 		pr_debug("msi: Using platform check routine.\n");
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index 009ec73..89648c1 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -348,7 +348,7 @@  static int rtas_msi_check_device(struct pci_dev *pdev, int nvec, int type)
 	quota = msi_quota_for_device(pdev, nvec);
 
 	if (quota && quota < nvec)
-		return quota;
+		return -ENOSPC;
 
 	return 0;
 }