All consumers now use C99 struct init and none of them sets `.setfd'.

My X230 still plays audio just fine:
azalia0 at pci0 dev 27 function 0 "Intel 7 Series HD Audio" rev 0x04: msi
azalia0: codecs: Realtek ALC269, Intel/0x2806, using Realtek ALC269
audio0 at azalia0

Feedback? OK?

diff --git a/share/man/man9/audio.9 b/share/man/man9/audio.9
index d441561fb96..e143fcfc676 100644
--- a/share/man/man9/audio.9
+++ b/share/man/man9/audio.9
@@ -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..c0dab1f6306 100644
--- a/sys/dev/audio.c
+++ b/sys/dev/audio.c
@@ -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..c82add7ccd3 100644
--- a/sys/dev/audio_if.h
+++ b/sys/dev/audio_if.h
@@ -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 *);

Reply via email to