aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sound/pcm/mixer.c
diff options
context:
space:
mode:
authorJosef El-Rayes <josef@FreeBSD.org>2004-06-24 17:41:20 +0000
committerJosef El-Rayes <josef@FreeBSD.org>2004-06-24 17:41:20 +0000
commit8ba7f5cfeebf0cd977d121b23f484fec3ff147cd (patch)
tree949034f7eca546942ded549b153152a37c8047b5 /sys/dev/sound/pcm/mixer.c
parent4f3bf9b9b4ad6de962684ebaca288e7289e3874e (diff)
downloadsrc-8ba7f5cfeebf0cd977d121b23f484fec3ff147cd.tar.gz
src-8ba7f5cfeebf0cd977d121b23f484fec3ff147cd.zip
Change the possibility to configure pcm(4) via boot/loader.conf
to use boot/device.hints now As discussed on cvs-src@ Reviewed by: Hiten Pandya <hmp@backplane.com>
Notes
Notes: svn path=/head/; revision=131064
Diffstat (limited to 'sys/dev/sound/pcm/mixer.c')
-rw-r--r--sys/dev/sound/pcm/mixer.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
index 7075a00add89..2b8d681cd316 100644
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -25,7 +25,6 @@
*/
#include <dev/sound/pcm/sound.h>
-#include <sys/kernel.h>
#include "mixer_if.h"
@@ -190,7 +189,6 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
{
struct snddev_info *snddev;
struct snd_mixer *m;
- char devname[20];
u_int16_t v;
struct cdev *pdev;
int i, unit, val;
@@ -206,13 +204,14 @@ mixer_init(device_t dev, kobj_class_t cls, void *devinfo)
goto bad;
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
- snprintf(devname, sizeof(devname), "%s.%s", device_get_nameunit(dev), snd_mixernames[i]);
- TUNABLE_INT_FETCH(devname, &val);
-
- if (val >= 0 && val <= 100)
- v = (u_int16_t) val;
- else
+ if (resource_int_value(device_get_name(dev),
+ device_get_unit(dev), snd_mixernames[i], &val) == 0) {
+ if (val >= 0 && val <= 100) {
+ v = (u_int16_t) val;
+ }
+ } else {
v = snd_mixerdefaults[i];
+ }
mixer_set(m, i, v | (v << 8));
}