From f9631a843e673df34fb2f7dbf1c960da14f75a47 Mon Sep 17 00:00:00 2001 From: kn Date: Wed, 19 Oct 2022 19:59:06 +0000 Subject: [PATCH] Remove unused setfd member from struct audio_hw_if All consumers now use C99 struct init and none of them sets `.setfd'. OK ratchov miod --- share/man/man9/audio.9 | 13 ++----------- sys/dev/audio.c | 7 +------ sys/dev/audio_if.h | 4 +--- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/share/man/man9/audio.9 b/share/man/man9/audio.9 index d441561fb96..c5e419aaf80 100644 --- a/share/man/man9/audio.9 +++ b/share/man/man9/audio.9 @@ -1,4 +1,4 @@ -.\" $OpenBSD: audio.9,v 1.31 2022/03/31 17:27:23 naddy Exp $ +.\" $OpenBSD: audio.9,v 1.32 2022/10/19 19:59:06 kn Exp $ .\" $NetBSD: audio.9,v 1.14 2000/02/11 22:56:15 kleink Exp $ .\" .\" Copyright (c) 1999, 2000 The NetBSD Foundation, Inc. @@ -28,7 +28,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd $Mdocdate: March 31 2022 $ +.Dd $Mdocdate: October 19 2022 $ .Dt AUDIO 9 .Os .Sh NAME @@ -64,8 +64,6 @@ struct audio_hw_if { #define SPKR_ON 1 #define SPKR_OFF 0 - int (*setfd)(void *, int); - int (*set_port)(void *, struct mixer_ctrl *); int (*get_port)(void *, struct mixer_ctrl *); @@ -284,13 +282,6 @@ If supplied, it is called when a half duplex device changes between playing and recording. It can, e.g., be used to turn the speaker on and off. This function returns 0 on success, otherwise an error code. -.It Ft int Fn (*setfd) "void *hdl" "int fd" -This function is optional. -If supplied, it is called when the device is opened in full-duplex mode, -but only if the device has -.Dv AUDIO_PROP_FULLDUPLEX -set. -This function returns 0 on success, otherwise an error code. .It Ft int Fn (*set_port) "void *hdl" "struct mixer_ctrl *mc" This function is called when the .Dv AUDIO_MIXER_WRITE diff --git a/sys/dev/audio.c b/sys/dev/audio.c index 8bb1e36bb2c..e06f51361b5 100644 --- a/sys/dev/audio.c +++ b/sys/dev/audio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: audio.c,v 1.200 2022/07/31 03:31:36 visa Exp $ */ +/* $OpenBSD: audio.c,v 1.201 2022/10/19 19:59:06 kn Exp $ */ /* * Copyright (c) 2015 Alexandre Ratchov * @@ -1499,11 +1499,6 @@ audio_open(struct audio_softc *sc, int flags) error = ENOTTY; goto bad; } - if (sc->ops->setfd) { - error = sc->ops->setfd(sc->arg, 1); - if (error) - goto bad; - } } if (sc->ops->speaker_ctl) { diff --git a/sys/dev/audio_if.h b/sys/dev/audio_if.h index b01b57caf41..97efa74c75c 100644 --- a/sys/dev/audio_if.h +++ b/sys/dev/audio_if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: audio_if.h,v 1.39 2022/10/18 08:22:18 kn Exp $ */ +/* $OpenBSD: audio_if.h,v 1.40 2022/10/19 19:59:07 kn Exp $ */ /* $NetBSD: audio_if.h,v 1.24 1998/01/10 14:07:25 tv Exp $ */ /* @@ -108,8 +108,6 @@ struct audio_hw_if { #define SPKR_ON 1 #define SPKR_OFF 0 - int (*setfd)(void *, int); - /* Mixer (in/out ports) */ int (*set_port)(void *, struct mixer_ctrl *); int (*get_port)(void *, struct mixer_ctrl *); -- 2.20.1