Date: Tue, 7 Nov 2006 21:33:05 GMT From: Olivier Houchard <cognet@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 109479 for review Message-ID: <200611072133.kA7LX5DT059131@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=109479 Change 109479 by cognet@cognet on 2006/11/07 21:32:51 Introduce ixpnpe_start_locked(), to be used from ixpnpe_init(), where we already hold the lock. Approved by: mux (mentor) Affected files ... .. //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_npe.c#4 edit Differences ... ==== //depot/projects/arm/src/sys/arm/xscale/ixp425/ixp425_npe.c#4 (text+ko) ==== @@ -329,25 +329,34 @@ return error; } -int -ixpnpe_start(struct ixpnpe_softc *sc) +static int +ixpnpe_start_locked(struct ixpnpe_softc *sc) { int error; - mtx_lock(&sc->sc_mtx); if (!sc->started) { error = npe_cpu_start(sc); if (error == 0) sc->started = 1; } else error = 0; - mtx_unlock(&sc->sc_mtx); DPRINTF(sc->sc_dev, "%s: error %d\n", __func__, error); return error; } int +ixpnpe_start(struct ixpnpe_softc *sc) +{ + int ret; + + mtx_lock(&sc->sc_mtx); + ret = ixpnpe_start_locked(sc); + mtx_unlock(&sc->sc_mtx); + return (ret); +} + +int ixpnpe_stop(struct ixpnpe_softc *sc) { int error; @@ -450,7 +459,7 @@ error = npe_load_image(sc, imageCodePtr, 1 /*VERIFY*/); if (error == 0) { sc->validImage = 1; - error = ixpnpe_start(sc); + error = ixpnpe_start_locked(sc); } else { sc->validImage = 0; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200611072133.kA7LX5DT059131>