aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/init.c
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2010-09-16 03:26:54 -0400
committerTakashi Iwai <tiwai@suse.de>2010-09-16 04:17:25 -0400
commit4437ecdc7190302ed02fb1467c116aff29c325b2 (patch)
tree707eef4bca82a1b8f6cf84deb4b48fa575e23715 /sound/core/init.c
parent1a4e34e67c6de2385d9d493e69c0f6fce886b14d (diff)
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>
Diffstat (limited to 'sound/core/init.c')
-rw-r--r--sound/core/init.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index ec4a50ce5656..2de45fbd70fb 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -607,11 +607,16 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr,
607 return -EEXIST; 607 return -EEXIST;
608 } 608 }
609 for (idx = 0; idx < snd_ecards_limit; idx++) { 609 for (idx = 0; idx < snd_ecards_limit; idx++) {
610 if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) 610 if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) {
611 goto __exist; 611 if (card == snd_cards[idx])
612 goto __ok;
613 else
614 goto __exist;
615 }
612 } 616 }
613 strcpy(card->id, buf1); 617 strcpy(card->id, buf1);
614 snd_info_card_id_change(card); 618 snd_info_card_id_change(card);
619__ok:
615 mutex_unlock(&snd_card_mutex); 620 mutex_unlock(&snd_card_mutex);
616 621
617 return count; 622 return count;