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>
This commit is contained in:
parent
1a4e34e67c
commit
4437ecdc71
1 changed files with 7 additions and 2 deletions
|
@ -607,11 +607,16 @@ card_id_store_attr(struct device *dev, struct device_attribute *attr,
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
for (idx = 0; idx < snd_ecards_limit; idx++) {
|
for (idx = 0; idx < snd_ecards_limit; idx++) {
|
||||||
if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1))
|
if (snd_cards[idx] && !strcmp(snd_cards[idx]->id, buf1)) {
|
||||||
goto __exist;
|
if (card == snd_cards[idx])
|
||||||
|
goto __ok;
|
||||||
|
else
|
||||||
|
goto __exist;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
strcpy(card->id, buf1);
|
strcpy(card->id, buf1);
|
||||||
snd_info_card_id_change(card);
|
snd_info_card_id_change(card);
|
||||||
|
__ok:
|
||||||
mutex_unlock(&snd_card_mutex);
|
mutex_unlock(&snd_card_mutex);
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
|
Loading…
Add table
Reference in a new issue