summaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@nokia.com>2010-09-16 10:26:54 +0300
committerTakashi Iwai <tiwai@suse.de>2010-09-16 10:17:25 +0200
commit4437ecdc7190302ed02fb1467c116aff29c325b2 (patch)
tree707eef4bca82a1b8f6cf84deb4b48fa575e23715 /sound/core
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')
-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 ec4a50ce565..2de45fbd70f 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,
return -EEXIST;
}
for (idx = 0; idx < snd_ecards_limit; idx++) {
- if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1))
- goto __exist;
+ if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) {
+ if (card == snd_cards[idx])
+ goto __ok;
+ else
+ goto __exist;
+ }
}
strcpy(card->id, buf1);
snd_info_card_id_change(card);
+__ok:
mutex_unlock(&snd_card_mutex);
return count;