summaryrefslogtreecommitdiffstats
path: root/sound/core/control.c
diff options
context:
space:
mode:
authorTakashi Iwai2006-08-04 12:57:19 +0200
committerJaroslav Kysela2006-09-23 10:39:59 +0200
commit2529bba7606b23c1b7161d3c2ad486162e8650f9 (patch)
treefc19403b51f9a8c3d080fac7acd50c3a95cb652c /sound/core/control.c
parent[ALSA] ppc-beep - handle errors from input_register_device() (diff)
downloadkernel-qcow2-linux-2529bba7606b23c1b7161d3c2ad486162e8650f9.tar.gz
kernel-qcow2-linux-2529bba7606b23c1b7161d3c2ad486162e8650f9.tar.xz
kernel-qcow2-linux-2529bba7606b23c1b7161d3c2ad486162e8650f9.zip
[ALSA] Fix substream selection in PCM and rawmidi
The PCM and rawmidi substreams can be selected explicitly by opening control handle and set via *_PREFER_SUBDEVICE ioctl. But, when multiple controls are opened, the driver gets confused. The patch fixes the initialization of prefer_*_subdevice and the check of multiple controls. The first set subdevice is picked up as the valid one. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/control.c')
-rw-r--r--sound/core/control.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/control.c b/sound/core/control.c
index 31ad58154c06..ac1442682eac 100644
--- a/sound/core/control.c
+++ b/sound/core/control.c
@@ -75,6 +75,8 @@ static int snd_ctl_open(struct inode *inode, struct file *file)
init_waitqueue_head(&ctl->change_sleep);
spin_lock_init(&ctl->read_lock);
ctl->card = card;
+ ctl->prefer_pcm_subdevice = -1;
+ ctl->prefer_rawmidi_subdevice = -1;
ctl->pid = current->pid;
file->private_data = ctl;
write_lock_irqsave(&card->ctl_files_rwlock, flags);