Fix order of USB serial layer uninit. Currently module dependency

rules prevent the USB serial module to be unloaded before any client
modules. This patch ensures that the "ucom_mtx" mutex is destroyed
last when doing a system uninit in a monotolith build aswell.

MFC after:	3 days
This commit is contained in:
Hans Petter Selasky 2014-07-01 07:30:29 +00:00
parent 71eaf0fda7
commit d9b6ab3a76
2 changed files with 2 additions and 2 deletions

View File

@ -200,7 +200,7 @@ ucom_uninit(void *arg)
mtx_destroy(&ucom_mtx);
}
SYSUNINIT(ucom_uninit, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_uninit, NULL);
SYSUNINIT(ucom_uninit, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_uninit, NULL);
/*
* Mark a unit number (the X in cuaUX) as in use.

View File

@ -195,7 +195,7 @@ struct ucom_softc {
#define UCOM_MTX_LOCK(sc) mtx_lock((sc)->sc_mtx)
#define UCOM_MTX_UNLOCK(sc) mtx_unlock((sc)->sc_mtx)
#define UCOM_UNLOAD_DRAIN(x) \
SYSUNINIT(var, SI_SUB_KLD - 3, SI_ORDER_ANY, ucom_drain_all, 0)
SYSUNINIT(var, SI_SUB_KLD - 2, SI_ORDER_ANY, ucom_drain_all, 0)
#define ucom_cfg_do_request(udev,com,req,ptr,flags,timo) \
usbd_do_request_proc(udev,&(com)->sc_super->sc_tq,req,ptr,flags,NULL,timo)