Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F166848508
D44840.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D44840.diff
View Options
diff --git a/sys/dev/sound/pcm/mixer.c b/sys/dev/sound/pcm/mixer.c
--- a/sys/dev/sound/pcm/mixer.c
+++ b/sys/dev/sound/pcm/mixer.c
@@ -726,14 +726,17 @@
struct snd_mixer *m;
u_int16_t v;
struct cdev *pdev;
+ const char *name;
int i, unit, devunit, val;
snddev = device_get_softc(dev);
if (snddev == NULL)
return (-1);
- if (resource_int_value(device_get_name(dev),
- device_get_unit(dev), "eq", &val) == 0 && val != 0) {
+ name = device_get_name(dev);
+ unit = device_get_unit(dev);
+ if (resource_int_value(name, unit, "eq", &val) == 0 &&
+ val != 0) {
snddev->flags |= SD_F_EQ;
if ((val & SD_F_EQ_MASK) == val)
snddev->flags |= val;
@@ -749,8 +752,8 @@
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
v = snd_mixerdefaults[i];
- if (resource_int_value(device_get_name(dev),
- device_get_unit(dev), snd_mixernames[i], &val) == 0) {
+ if (resource_int_value(name, unit, snd_mixernames[i],
+ &val) == 0) {
if (val >= 0 && val <= 100) {
v = (u_int16_t) val;
}
@@ -761,7 +764,6 @@
mixer_setrecsrc(m, 0); /* Set default input. */
- unit = device_get_unit(dev);
devunit = snd_mkunit(unit, SND_DEV_CTL, 0);
pdev = make_dev(&mixer_cdevsw, PCMMINOR(devunit),
UID_ROOT, GID_WHEEL, 0666, "mixer%d", unit);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 18, 2:11 AM (13 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
36882107
Default Alt Text
D44840.diff (1 KB)
Attached To
Mode
D44840: sound: Call device_get_name() and device_get_unit() only once in mixer_init()
Attached
Detach File
Event Timeline
Log In to Comment