Make mutex name reflect device driver name.
Destroy mutex when detaching the device. Submitted by: John Baldwin <jhb@FreeBSD.ORG>
This commit is contained in:
parent
1e856a7b34
commit
f59dd3ae6a
@ -317,7 +317,7 @@ fxp_attach(device_t dev)
|
||||
u_long val;
|
||||
int rid;
|
||||
|
||||
mtx_init(&sc->sc_mtx, "fxp", MTX_DEF);
|
||||
mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_DEF);
|
||||
callout_handle_init(&sc->stat_ch);
|
||||
|
||||
FXP_LOCK(sc);
|
||||
@ -453,6 +453,7 @@ fxp_detach(device_t dev)
|
||||
free(sc->mcsp, M_DEVBUF);
|
||||
|
||||
FXP_UNLOCK(sc);
|
||||
mtx_destroy(&sc->sc_mtx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -317,7 +317,7 @@ fxp_attach(device_t dev)
|
||||
u_long val;
|
||||
int rid;
|
||||
|
||||
mtx_init(&sc->sc_mtx, "fxp", MTX_DEF);
|
||||
mtx_init(&sc->sc_mtx, device_get_nameunit(dev), MTX_DEF);
|
||||
callout_handle_init(&sc->stat_ch);
|
||||
|
||||
FXP_LOCK(sc);
|
||||
@ -453,6 +453,7 @@ fxp_detach(device_t dev)
|
||||
free(sc->mcsp, M_DEVBUF);
|
||||
|
||||
FXP_UNLOCK(sc);
|
||||
mtx_destroy(&sc->sc_mtx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user