Commit 4437ecdc7190302ed02fb1467c116aff29c325b2
Committed by
Takashi Iwai
1 parent
1a4e34e67c
Exists in
master
and in
20 other branches
ALSA: core: Allow card id change to the same string
When user want to change the card id to the same string on the card via /sys/class/sound/cardX/id, do not report error. Instead return with success without doing anything. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Showing 1 changed file with 7 additions and 2 deletions Side-by-side Diff
sound/core/init.c
... | ... | @@ -607,11 +607,16 @@ |
607 | 607 | return -EEXIST; |
608 | 608 | } |
609 | 609 | for (idx = 0; idx < snd_ecards_limit; idx++) { |
610 | - if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) | |
611 | - goto __exist; | |
610 | + if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) { | |
611 | + if (card == snd_cards[idx]) | |
612 | + goto __ok; | |
613 | + else | |
614 | + goto __exist; | |
615 | + } | |
612 | 616 | } |
613 | 617 | strcpy(card->id, buf1); |
614 | 618 | snd_info_card_id_change(card); |
619 | +__ok: | |
615 | 620 | mutex_unlock(&snd_card_mutex); |
616 | 621 | |
617 | 622 | return count; |