summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorroger <roger@FreeBSD.org>2000-09-11 12:23:50 +0000
committerroger <roger@FreeBSD.org>2000-09-11 12:23:50 +0000
commitb4359f45816a22fbd83eee24c0fea3edcc78a450 (patch)
treefe9eb5c1ae535baab4517610cd306fc6aa67127b /sys
parent95fdf432c0932babde8fb0cf7bcd124ab0c882d7 (diff)
downloadFreeBSD-src-b4359f45816a22fbd83eee24c0fea3edcc78a450.zip
FreeBSD-src-b4359f45816a22fbd83eee24c0fea3edcc78a450.tar.gz
Make MOD_UNLOAD return EBUSY to prevent it being unloaded automatically when we
unload the bktr driver. Change the sub-section from SI_SUB_PSEDUO to SI_SUB_DRIVERS to make sure the module initialises before the bktr module
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/bktr/bktr_mem.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/dev/bktr/bktr_mem.c b/sys/dev/bktr/bktr_mem.c
index 5e2c8e8..84fb879 100644
--- a/sys/dev/bktr/bktr_mem.c
+++ b/sys/dev/bktr/bktr_mem.c
@@ -87,8 +87,8 @@ bktr_mem_modevent(module_t mod, int type, void *unused){
}
case MOD_UNLOAD:
{
- printf("bktr_mem: memory holder unloaded\n");
- return 0;
+ printf("bktr_mem: memory holder cannot be unloaded\n");
+ return EBUSY;
}
default:
break;
@@ -169,6 +169,7 @@ static moduledata_t bktr_mem_mod = {
bktr_mem_modevent,
0
};
-/* The load order is First so bktr_mem loads (and initialises) before bktr */
-DECLARE_MODULE(bktr_mem, bktr_mem_mod, SI_SUB_PSEUDO, SI_ORDER_FIRST);
+/* The load order is First and module type is Driver to make sure bktr_mem
+ loads (and initialises) before bktr when both are loaded together */
+DECLARE_MODULE(bktr_mem, bktr_mem_mod, SI_SUB_DRIVERS, SI_ORDER_FIRST);
MODULE_VERSION(bktr_mem, 1);
OpenPOWER on IntegriCloud