sound: Merge PCM_ALIVE() with PCM_REGISTERED()

PCM_ALIVE() is used only in pcm_unregister(), but it does not hurt to
use PCM_REGISTERED(), which uses PCM_ALIVE() internally. In fact, it's
more robust this way.

Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Christos Margiolis
2025-11-21 17:14:24 +01:00
parent 4e8eb77880
commit 3107b952f5
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -467,7 +467,7 @@ pcm_unregister(device_t dev)
d = device_get_softc(dev);
if (!PCM_ALIVE(d)) {
if (!PCM_REGISTERED(d)) {
device_printf(dev, "unregister: device not configured\n");
return (0);
}
+2 -2
View File
@@ -133,8 +133,8 @@ struct snd_mixer;
"\015PVCHANS" \
"\016RVCHANS"
#define PCM_ALIVE(x) ((x) != NULL && (x)->lock != NULL)
#define PCM_REGISTERED(x) (PCM_ALIVE(x) && ((x)->flags & SD_F_REGISTERED))
#define PCM_REGISTERED(x) \
((x) != NULL && (x)->lock != NULL && ((x)->flags & SD_F_REGISTERED))
#define PCM_MAXCHANS 10000
#define PCM_CHANCOUNT(d) \