From: Peter Ujfalusi Date: Thu, 16 Sep 2010 07:26:54 +0000 (+0300) Subject: ALSA: core: Allow card id change to the same string X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4437ecdc7190302ed02fb1467c116aff29c325b2;p=linux-beck.git 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 Signed-off-by: Takashi Iwai --- 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, 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;