summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/if_udav.c
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2008-01-08 23:48:31 +0000
committerattilio <attilio@FreeBSD.org>2008-01-08 23:48:31 +0000
commit9e182da1916d63733010443cc5d45688fe47c3e7 (patch)
tree8b4bc5a73ee6f8eec360e2bca8b5a48ec5a6bea6 /sys/dev/usb/if_udav.c
parent1975c095433557ab04b0b28101fb49a9320af637 (diff)
downloadFreeBSD-src-9e182da1916d63733010443cc5d45688fe47c3e7.zip
FreeBSD-src-9e182da1916d63733010443cc5d45688fe47c3e7.tar.gz
Remove explicit calling of lockmgr() with the NULL argument.
Now, lockmgr() function can only be called passing curthread and the KASSERT() is upgraded according with this. In order to support on-the-fly owner switching, the new function lockmgr_disown() has been introduced and gets used in BUF_KERNPROC(). KPI, so, results changed and FreeBSD version will be bumped soon. Differently from previous code, we assume idle thread cannot try to acquire the lockmgr as it cannot sleep, so loose the relative check[1] in BUF_KERNPROC(). Tested by: kris [1] kib asked for a KASSERT in the lockmgr_disown() about this condition, but after thinking at it, as this is a well known general rule, I found it not really necessary.
Diffstat (limited to 'sys/dev/usb/if_udav.c')
-rw-r--r--sys/dev/usb/if_udav.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/if_udav.c b/sys/dev/usb/if_udav.c
index cc42477..869132c 100644
--- a/sys/dev/usb/if_udav.c
+++ b/sys/dev/usb/if_udav.c
@@ -1780,7 +1780,7 @@ udav_lock_mii(struct udav_softc *sc)
#if defined(__NetBSD__)
lockmgr(&sc->sc_mii_lock, LK_EXCLUSIVE, NULL);
#elif defined(__FreeBSD__)
- lockmgr(&sc->sc_mii_lock, LK_EXCLUSIVE, NULL, NULL);
+ lockmgr(&sc->sc_mii_lock, LK_EXCLUSIVE, NULL, curthread);
#endif
}
@@ -1793,7 +1793,7 @@ udav_unlock_mii(struct udav_softc *sc)
#if defined(__NetBSD__)
lockmgr(&sc->sc_mii_lock, LK_RELEASE, NULL);
#elif defined(__FreeBSD__)
- lockmgr(&sc->sc_mii_lock, LK_RELEASE, NULL, NULL);
+ lockmgr(&sc->sc_mii_lock, LK_RELEASE, NULL, curthread);
#endif
if (--sc->sc_refcnt < 0)
usb_detach_wakeup(sc->sc_dev);
OpenPOWER on IntegriCloud