Module Name:    src
Committed By:   pgoyette
Date:           Sun Jul 25 14:14:26 UTC 2010

Modified Files:
        src/sys/dev/pci: pci_subr.c pci_verbose.c

Log Message:
Move setting of pci_verbose_loaded flag into the module's init routine.
This ensures that the flag is set even if the module was manually loaded
by the user rather than just auto-loaded.


To generate a diff of this commit:
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/pci/pci_verbose.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/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.83 src/sys/dev/pci/pci_subr.c:1.84
--- src/sys/dev/pci/pci_subr.c:1.83	Sun Jun  6 18:58:23 2010
+++ src/sys/dev/pci/pci_subr.c	Sun Jul 25 14:14:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.83 2010/06/06 18:58:23 pgoyette Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.84 2010/07/25 14:14:25 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.83 2010/06/06 18:58:23 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.84 2010/07/25 14:14:25 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -323,13 +323,11 @@
  */
 void pci_load_verbose(void)
 {
-	if (pciverbose_loaded)
-		return;
-
-	mutex_enter(&module_lock);
-	if (module_autoload("pciverbose", MODULE_CLASS_MISC) == 0 )
-		pciverbose_loaded++;
-	mutex_exit(&module_lock);
+	if (pciverbose_loaded == 0) {
+		mutex_enter(&module_lock);
+		module_autoload("pciverbose", MODULE_CLASS_MISC);
+		mutex_exit(&module_lock);
+	}
 }
 
 const char *pci_findvendor_stub(pcireg_t id_reg)

Index: src/sys/dev/pci/pci_verbose.c
diff -u src/sys/dev/pci/pci_verbose.c:1.6 src/sys/dev/pci/pci_verbose.c:1.7
--- src/sys/dev/pci/pci_verbose.c:1.6	Sun Jun  6 18:58:24 2010
+++ src/sys/dev/pci/pci_verbose.c	Sun Jul 25 14:14:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_verbose.c,v 1.6 2010/06/06 18:58:24 pgoyette Exp $	*/
+/*	$NetBSD: pci_verbose.c,v 1.7 2010/07/25 14:14:25 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_verbose.c,v 1.6 2010/06/06 18:58:24 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_verbose.c,v 1.7 2010/07/25 14:14:25 pgoyette Exp $");
 
 #include <sys/param.h>
 
@@ -86,6 +86,7 @@
 		pci_findvendor = pci_findvendor_real;
 		pci_findproduct = pci_findproduct_real;
 		pci_unmatched = "unmatched ";
+		pciverbose_loaded = 1;
 		return 0;
 	case MODULE_CMD_FINI:
 		pci_findvendor = saved_findvendor;

Reply via email to