Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/mii Move setting of mii_verbose_loaded flag into the...
details: https://anonhg.NetBSD.org/src/rev/9edcf28a2fd9
branches: trunk
changeset: 756588:9edcf28a2fd9
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Sun Jul 25 14:44:34 2010 +0000
description:
Move setting of mii_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/mii/mii_physubr.c | 16 +++++++---------
sys/dev/mii/mii_verbose.c | 5 +++--
2 files changed, 10 insertions(+), 11 deletions(-)
diffs (63 lines):
diff -r ede789865574 -r 9edcf28a2fd9 sys/dev/mii/mii_physubr.c
--- a/sys/dev/mii/mii_physubr.c Sun Jul 25 14:14:25 2010 +0000
+++ b/sys/dev/mii/mii_physubr.c Sun Jul 25 14:44:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mii_physubr.c,v 1.70 2010/06/06 18:58:22 pgoyette Exp $ */
+/* $NetBSD: mii_physubr.c,v 1.71 2010/07/25 14:44:34 pgoyette Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.70 2010/06/06 18:58:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_physubr.c,v 1.71 2010/07/25 14:44:34 pgoyette Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -71,13 +71,11 @@
*/
void mii_load_verbose(void)
{
- if (mii_verbose_loaded)
- return;
-
- mutex_enter(&module_lock);
- if (module_autoload("miiverbose", MODULE_CLASS_MISC) ==0)
- mii_verbose_loaded++;
- mutex_exit(&module_lock);
+ if (mii_verbose_loaded == 0) {
+ mutex_enter(&module_lock);
+ module_autoload("miiverbose", MODULE_CLASS_MISC);
+ mutex_exit(&module_lock);
+ }
}
static void mii_phy_statusmsg(struct mii_softc *);
diff -r ede789865574 -r 9edcf28a2fd9 sys/dev/mii/mii_verbose.c
--- a/sys/dev/mii/mii_verbose.c Sun Jul 25 14:14:25 2010 +0000
+++ b/sys/dev/mii/mii_verbose.c Sun Jul 25 14:44:34 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mii_verbose.c,v 1.2 2010/06/06 18:58:22 pgoyette Exp $ */
+/* $NetBSD: mii_verbose.c,v 1.3 2010/07/25 14:44:34 pgoyette Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mii_verbose.c,v 1.2 2010/06/06 18:58:22 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mii_verbose.c,v 1.3 2010/07/25 14:44:34 pgoyette Exp $");
#include <sys/module.h>
#include <dev/mii/mii_verbose.h>
@@ -81,6 +81,7 @@
case MODULE_CMD_INIT:
saved_mii_get_descr = mii_get_descr;
mii_get_descr = mii_get_descr_real;
+ mii_verbose_loaded = 1;
return 0;
case MODULE_CMD_FINI:
mii_get_descr = saved_mii_get_descr;
Home |
Main Index |
Thread Index |
Old Index