Skip to content

Commit 4437ecd

Browse files
Peter Ujfalusitiwai
authored andcommitted
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>
1 parent 1a4e34e commit 4437ecd

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎sound/core/init.c‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,11 +607,16 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr,
607607
return -EEXIST;
608608
}
609609
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+
}
612616
}
613617
strcpy(card->id, buf1);
614618
snd_info_card_id_change(card);
619+
__ok:
615620
mutex_unlock(&snd_card_mutex);
616621

617622
return count;

0 commit comments

Comments
 (0)