diff options
| -rw-r--r-- | sound/core/rawmidi.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sound/core/rawmidi.c b/sound/core/rawmidi.c index b3b353d72527..f055ca10bbc1 100644 --- a/sound/core/rawmidi.c +++ b/sound/core/rawmidi.c | |||
| @@ -579,15 +579,14 @@ static int snd_rawmidi_info_user(struct snd_rawmidi_substream *substream, | |||
| 579 | return 0; | 579 | return 0; |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info) | 582 | static int __snd_rawmidi_info_select(struct snd_card *card, |
| 583 | struct snd_rawmidi_info *info) | ||
| 583 | { | 584 | { |
| 584 | struct snd_rawmidi *rmidi; | 585 | struct snd_rawmidi *rmidi; |
| 585 | struct snd_rawmidi_str *pstr; | 586 | struct snd_rawmidi_str *pstr; |
| 586 | struct snd_rawmidi_substream *substream; | 587 | struct snd_rawmidi_substream *substream; |
| 587 | 588 | ||
| 588 | mutex_lock(®ister_mutex); | ||
| 589 | rmidi = snd_rawmidi_search(card, info->device); | 589 | rmidi = snd_rawmidi_search(card, info->device); |
| 590 | mutex_unlock(®ister_mutex); | ||
| 591 | if (!rmidi) | 590 | if (!rmidi) |
| 592 | return -ENXIO; | 591 | return -ENXIO; |
| 593 | if (info->stream < 0 || info->stream > 1) | 592 | if (info->stream < 0 || info->stream > 1) |
| @@ -603,6 +602,16 @@ int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info | |||
| 603 | } | 602 | } |
| 604 | return -ENXIO; | 603 | return -ENXIO; |
| 605 | } | 604 | } |
| 605 | |||
| 606 | int snd_rawmidi_info_select(struct snd_card *card, struct snd_rawmidi_info *info) | ||
| 607 | { | ||
| 608 | int ret; | ||
| 609 | |||
| 610 | mutex_lock(®ister_mutex); | ||
| 611 | ret = __snd_rawmidi_info_select(card, info); | ||
| 612 | mutex_unlock(®ister_mutex); | ||
| 613 | return ret; | ||
| 614 | } | ||
| 606 | EXPORT_SYMBOL(snd_rawmidi_info_select); | 615 | EXPORT_SYMBOL(snd_rawmidi_info_select); |
| 607 | 616 | ||
| 608 | static int snd_rawmidi_info_select_user(struct snd_card *card, | 617 | static int snd_rawmidi_info_select_user(struct snd_card *card, |
