diff options
author | Christos Margiolis <christos@FreeBSD.org> | 2024-04-18 20:35:20 +0000 |
---|---|---|
committer | Christos Margiolis <christos@FreeBSD.org> | 2024-05-17 19:30:01 +0000 |
commit | 98157281725b3eed5612753d8150b3edfd01c1b5 (patch) | |
tree | 37aba7a2862612bf18fd90214f86dd58d49b860f /sys | |
parent | decc224ab8993797473a5d37d60588a021965d2f (diff) | |
download | src-98157281725b3eed5612753d8150b3edfd01c1b5.tar.gz src-98157281725b3eed5612753d8150b3edfd01c1b5.zip |
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/sound/pcm/dsp.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index aa6c21f36601..df1482d6a97a 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -2185,7 +2185,7 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) struct pcm_channel *ch; struct snddev_info *d; uint32_t fmts; - int i, nchan, *rates, minch, maxch; + int i, nchan, *rates, minch, maxch, unit; char *devname, buf[CHN_NAMELEN]; /* @@ -2205,9 +2205,9 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) * Search for the requested audio device (channel). Start by * iterating over pcm devices. */ - for (i = 0; pcm_devclass != NULL && - i < devclass_get_maxunit(pcm_devclass); i++) { - d = devclass_get_softc(pcm_devclass, i); + for (unit = 0; pcm_devclass != NULL && + unit < devclass_get_maxunit(pcm_devclass); unit++) { + d = devclass_get_softc(pcm_devclass, unit); if (!PCM_REGISTERED(d)) continue; @@ -2332,14 +2332,13 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *ai) * @todo @c port_number - routing information? */ ai->port_number = -1; - ai->mixer_dev = (d->mixer_dev != NULL) ? PCMUNIT(d->mixer_dev) : -1; + ai->mixer_dev = (d->mixer_dev != NULL) ? unit : -1; /** * @note * @c real_device - OSSv4 docs: "Obsolete." */ ai->real_device = -1; - snprintf(ai->devnode, sizeof(ai->devnode), - "/dev/dsp%d", device_get_unit(d->dev)); + snprintf(ai->devnode, sizeof(ai->devnode), "/dev/dsp%d", unit); ai->enabled = device_is_attached(d->dev) ? 1 : 0; /** * @note |