Module Name: src Committed By: riastradh Date: Sun Oct 23 23:03:30 UTC 2022
Modified Files: src/sys/dev: midi.c Log Message: midi(4): No need to take lock just for callout_halt. Lock is relevant only if we're doing something _else_ under the lock that must be serialized with the callout's own action. To generate a diff of this commit: cvs rdiff -u -r1.100 -r1.101 src/sys/dev/midi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/midi.c diff -u src/sys/dev/midi.c:1.100 src/sys/dev/midi.c:1.101 --- src/sys/dev/midi.c:1.100 Sun Oct 23 23:03:13 2022 +++ src/sys/dev/midi.c Sun Oct 23 23:03:30 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: midi.c,v 1.100 2022/10/23 23:03:13 riastradh Exp $ */ +/* $NetBSD: midi.c,v 1.101 2022/10/23 23:03:30 riastradh Exp $ */ /* * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.100 2022/10/23 23:03:13 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: midi.c,v 1.101 2022/10/23 23:03:30 riastradh Exp $"); #ifdef _KERNEL_OPT #include "midi.h" @@ -246,10 +246,8 @@ mididetach(device_t self, int flags) sc->sih = NULL; } - mutex_enter(sc->lock); - callout_halt(&sc->xmt_asense_co, sc->lock); - callout_halt(&sc->rcv_asense_co, sc->lock); - mutex_exit(sc->lock); + callout_halt(&sc->xmt_asense_co, NULL); + callout_halt(&sc->rcv_asense_co, NULL); callout_destroy(&sc->xmt_asense_co); callout_destroy(&sc->rcv_asense_co);