git: 5c36d1b5c99a - stable/15 - snd_uaudio: Retire sndcard_func usage

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Mon, 06 Apr 2026 09:19:05 UTC
The branch stable/15 has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=5c36d1b5c99accb632ee7fb0339e495aabfb5706

commit 5c36d1b5c99accb632ee7fb0339e495aabfb5706
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-03-30 14:13:16 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-04-06 09:18:59 +0000

    snd_uaudio: Retire sndcard_func usage
    
    This is effectively a no-op, as it does not make use of the
    sndcard_func->varinfo field, so eventually ua_probe() always succeeds.
    
    Also change ua_probe()'s value to 0. There is no need to return
    BUS_PROBE_DEFAULT, because snd_uaudio() attaches the sound(4)'s children
    with bus_attach_children().
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D56160
    
    (cherry picked from commit 0efd33382504d3172734fa21325fcabef9c7f063)
---
 sys/dev/sound/usb/uaudio.c     |  5 -----
 sys/dev/sound/usb/uaudio_pcm.c | 13 +------------
 2 files changed, 1 insertion(+), 17 deletions(-)

diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index dd8aa8c9fafe..65976ced8a75 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -367,7 +367,6 @@ struct uaudio_softc_child {
 };
 
 struct uaudio_softc {
-	struct sndcard_func sc_sndcard_func;
 	struct uaudio_chan sc_rec_chan[UAUDIO_MAX_CHILD];
 	struct uaudio_chan sc_play_chan[UAUDIO_MAX_CHILD];
 	struct umidi_chan sc_midi_chan;
@@ -1112,8 +1111,6 @@ uaudio_attach(device_t dev)
 
 	/* attach the children */
 
-	sc->sc_sndcard_func.func = SCF_PCM;
-
 	/*
 	 * Only attach a PCM device if we have a playback, recording
 	 * or mixer device present:
@@ -1130,8 +1127,6 @@ uaudio_attach(device_t dev)
 			DPRINTF("out of memory\n");
 			goto detach;
 		}
-		device_set_ivars(sc->sc_child[i].pcm_device,
-		    &sc->sc_sndcard_func);
 	}
 
 	bus_attach_children(dev);
diff --git a/sys/dev/sound/usb/uaudio_pcm.c b/sys/dev/sound/usb/uaudio_pcm.c
index 0b3da9b20440..c24c111f983c 100644
--- a/sys/dev/sound/usb/uaudio_pcm.c
+++ b/sys/dev/sound/usb/uaudio_pcm.c
@@ -190,18 +190,7 @@ MIXER_DECLARE(ua_mixer);
 static int
 ua_probe(device_t dev)
 {
-	struct sndcard_func *func;
-
-	/* the parent device has already been probed */
-
-	func = device_get_ivars(dev);
-
-	if ((func == NULL) ||
-	    (func->func != SCF_PCM)) {
-		return (ENXIO);
-	}
-
-	return (BUS_PROBE_DEFAULT);
+	return (0);
 }
 
 static int