Module Name:    src
Committed By:   martin
Date:           Sun Aug  4 19:25:48 UTC 2019

Modified Files:
        src/sys/arch/arm/pci [netbsd-9]: pci_msi_machdep.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #18):

        sys/arch/arm/pci/pci_msi_machdep.c: revision 1.7

Properly honour max_type arg to pci_intr_alloc


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.2.1 src/sys/arch/arm/pci/pci_msi_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/arm/pci/pci_msi_machdep.c
diff -u src/sys/arch/arm/pci/pci_msi_machdep.c:1.6 src/sys/arch/arm/pci/pci_msi_machdep.c:1.6.2.1
--- src/sys/arch/arm/pci/pci_msi_machdep.c:1.6	Thu Jul 25 00:42:43 2019
+++ src/sys/arch/arm/pci/pci_msi_machdep.c	Sun Aug  4 19:25:48 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_msi_machdep.c,v 1.6 2019/07/25 00:42:43 jmcneill Exp $ */
+/* $NetBSD: pci_msi_machdep.c,v 1.6.2.1 2019/08/04 19:25:48 martin Exp $ */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.6 2019/07/25 00:42:43 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_msi_machdep.c,v 1.6.2.1 2019/08/04 19:25:48 martin Exp $");
 
 #include <sys/kernel.h>
 #include <sys/kmem.h>
@@ -186,11 +186,10 @@ pci_intr_alloc(const struct pci_attach_a
 	int intx_count, msi_count, msix_count, error;
 
 	error = EINVAL;
-	intx_count = 1;
-	msi_count = 1;
-	msix_count = 1;
 
 	if (counts != NULL) {
+		intx_count = msi_count = msix_count = 0;
+
 		switch (max_type) {
 		case PCI_INTR_TYPE_MSIX:
 			msix_count = counts[PCI_INTR_TYPE_MSIX];
@@ -207,6 +206,8 @@ pci_intr_alloc(const struct pci_attach_a
 			return EINVAL;
 		}
 		memset(counts, 0, sizeof(*counts) * PCI_INTR_TYPE_SIZE);
+	} else {
+		intx_count = msi_count = msix_count = 1;
 	}
 
 	if (msix_count == -1)

Reply via email to