Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/pci Move setting of pci_verbose_loaded flag into the...
details: https://anonhg.NetBSD.org/src/rev/ede789865574
branches: trunk
changeset: 756587:ede789865574
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sun Jul 25 14:14:25 2010 +0000
description:
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.
diffstat:
sys/dev/pci/pci_subr.c | 16 +++++++---------
sys/dev/pci/pci_verbose.c | 5 +++--
2 files changed, 10 insertions(+), 11 deletions(-)
diffs (63 lines):
diff -r dbddd26cb0b0 -r ede789865574 sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c Sun Jul 25 13:49:58 2010 +0000
+++ b/sys/dev/pci/pci_subr.c Sun Jul 25 14:14:25 2010 +0000
@@ -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)
diff -r dbddd26cb0b0 -r ede789865574 sys/dev/pci/pci_verbose.c
--- a/sys/dev/pci/pci_verbose.c Sun Jul 25 13:49:58 2010 +0000
+++ b/sys/dev/pci/pci_verbose.c Sun Jul 25 14:14:25 2010 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index