git: 6417651b4a9b - main - sound: Retire PCM_LOCK in sound_oss_card_info()

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Wed, 18 Nov 2026 10:24:42 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=6417651b4a9bb84b3052a60d2966ea9c9ecb9499

commit 6417651b4a9bb84b3052a60d2966ea9c9ecb9499
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-11-18 10:21:50 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-11-18 10:21:50 +0000

    sound: Retire PCM_LOCK in sound_oss_card_info()
    
    The handler reads the device name, its description and the status
    string. All three are set before pcm_register() makes the device
    visible, and never change afterwards. The topology lock, which is held
    across the whole function, makes sure the device is not freed.
    
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    markj
    Differential Revision:  https://reviews.freebsd.org/D60515
---
 sys/dev/sound/pcm/sound.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c
index 267d48f79ad9..65b43a66d758 100644
--- a/sys/dev/sound/pcm/sound.c
+++ b/sys/dev/sound/pcm/sound.c
@@ -614,17 +614,12 @@ sound_oss_card_info(oss_card_info *si)
 			si->hw_info[0] = '\0';
 			si->intr_count = si->ack_count = 0;
 		} else {
-			PCM_UNLOCKASSERT(d);
-			PCM_LOCK(d);
-
 			strlcpy(si->shortname, device_get_nameunit(d->dev),
 			    sizeof(si->shortname));
 			strlcpy(si->longname, device_get_desc(d->dev),
 			    sizeof(si->longname));
 			strlcpy(si->hw_info, d->status, sizeof(si->hw_info));
 			si->intr_count = si->ack_count = 0;
-
-			PCM_UNLOCK(d);
 		}
 
 		bus_topo_unlock();