diff options
Diffstat (limited to 'sound/core')
-rw-r--r-- | sound/core/control.c | 2 | ||||
-rw-r--r-- | sound/core/pcm.c | 3 | ||||
-rw-r--r-- | sound/core/rawmidi.c | 3 |
3 files changed, 6 insertions, 2 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) | |||
75 | init_waitqueue_head(&ctl->change_sleep); | 75 | init_waitqueue_head(&ctl->change_sleep); |
76 | spin_lock_init(&ctl->read_lock); | 76 | spin_lock_init(&ctl->read_lock); |
77 | ctl->card = card; | 77 | ctl->card = card; |
78 | ctl->prefer_pcm_subdevice = -1; | ||
79 | ctl->prefer_rawmidi_subdevice = -1; | ||
78 | ctl->pid = current->pid; | 80 | ctl->pid = current->pid; |
79 | file->private_data = ctl; | 81 | file->private_data = ctl; |
80 | write_lock_irqsave(&card->ctl_files_rwlock, flags); | 82 | write_lock_irqsave(&card->ctl_files_rwlock, flags); |
diff --git a/sound/core/pcm.c b/sound/core/pcm.c index f52178abf120..ed3b09469560 100644 --- a/sound/core/pcm.c +++ b/sound/core/pcm.c | |||
@@ -792,7 +792,8 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, | |||
792 | kctl = snd_ctl_file(list); | 792 | kctl = snd_ctl_file(list); |
793 | if (kctl->pid == current->pid) { | 793 | if (kctl->pid == current->pid) { |
794 | prefer_subdevice = kctl->prefer_pcm_subdevice; | 794 | prefer_subdevice = kctl->prefer_pcm_subdevice; |
795 | break; | 795 | if (prefer_subdevice != -1) |
796 | break; | ||
796 | } | 797 | } |
797 | } | 798 | } |
798 | up_read(&card->controls_rwsem); | 799 | up_read(&card->controls_rwsem); |
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index 8a2bdfae63e3..269c467ca9bb 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
@@ -430,7 +430,8 @@ static int snd_rawmidi_open(struct inode *inode, struct file *file) | |||
430 | kctl = snd_ctl_file(list); | 430 | kctl = snd_ctl_file(list); |
431 | if (kctl->pid == current->pid) { | 431 | if (kctl->pid == current->pid) { |
432 | subdevice = kctl->prefer_rawmidi_subdevice; | 432 | subdevice = kctl->prefer_rawmidi_subdevice; |
433 | break; | 433 | if (subdevice != -1) |
434 | break; | ||
434 | } | 435 | } |
435 | } | 436 | } |
436 | up_read(&card->controls_rwsem); | 437 | up_read(&card->controls_rwsem); |