Merge branch 'topic/mute-led' into for-next

Pull mute-LED helper fixes from Jaroslav.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2021-04-01 10:04:31 +02:00
commit 1678320e74
2 changed files with 7 additions and 2 deletions

View File

@ -2074,7 +2074,7 @@ void snd_ctl_disconnect_layer(struct snd_ctl_layer_ops *lops)
struct snd_ctl_layer_ops *lops2, *prev_lops2; struct snd_ctl_layer_ops *lops2, *prev_lops2;
down_write(&snd_ctl_layer_rwsem); down_write(&snd_ctl_layer_rwsem);
for (lops2 = snd_ctl_layer, prev_lops2 = NULL; lops2; lops2 = lops2->next) for (lops2 = snd_ctl_layer, prev_lops2 = NULL; lops2; lops2 = lops2->next) {
if (lops2 == lops) { if (lops2 == lops) {
if (!prev_lops2) if (!prev_lops2)
snd_ctl_layer = lops->next; snd_ctl_layer = lops->next;
@ -2082,6 +2082,8 @@ void snd_ctl_disconnect_layer(struct snd_ctl_layer_ops *lops)
prev_lops2->next = lops->next; prev_lops2->next = lops->next;
break; break;
} }
prev_lops2 = lops2;
}
up_write(&snd_ctl_layer_rwsem); up_write(&snd_ctl_layer_rwsem);
} }
EXPORT_SYMBOL_GPL(snd_ctl_disconnect_layer); EXPORT_SYMBOL_GPL(snd_ctl_disconnect_layer);

View File

@ -506,7 +506,7 @@ static char *parse_iface(char *s, unsigned int *val)
static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, size_t count, static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, size_t count,
bool attach) bool attach)
{ {
char buf2[256], *s; char buf2[256], *s, *os;
size_t len = max(sizeof(s) - 1, count); size_t len = max(sizeof(s) - 1, count);
struct snd_ctl_elem_id id; struct snd_ctl_elem_id id;
int err; int err;
@ -517,6 +517,7 @@ static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, si
id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
s = buf2; s = buf2;
while (*s) { while (*s) {
os = s;
if (!strncasecmp(s, "numid=", 6)) { if (!strncasecmp(s, "numid=", 6)) {
s = parse_uint(s + 6, &id.numid); s = parse_uint(s + 6, &id.numid);
} else if (!strncasecmp(s, "iface=", 6)) { } else if (!strncasecmp(s, "iface=", 6)) {
@ -546,6 +547,8 @@ static ssize_t set_led_id(struct snd_ctl_led_card *led_card, const char *buf, si
} }
if (*s == ',') if (*s == ',')
s++; s++;
if (s == os)
break;
} }
err = snd_ctl_led_set_id(led_card->number, &id, led_card->led->group, attach); err = snd_ctl_led_set_id(led_card->number, &id, led_card->led->group, attach);