diff options
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 9dd2d1d63981..8d8a8dc6857e 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -363,11 +363,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
363 | val = soc_widget_read(w, e->reg); | 363 | val = soc_widget_read(w, e->reg); |
364 | item = (val >> e->shift_l) & e->mask; | 364 | item = (val >> e->shift_l) & e->mask; |
365 | 365 | ||
366 | p->connect = 0; | 366 | if (item < e->max && !strcmp(p->name, e->texts[item])) |
367 | for (i = 0; i < e->max; i++) { | 367 | p->connect = 1; |
368 | if (!(strcmp(p->name, e->texts[i])) && item == i) | 368 | else |
369 | p->connect = 1; | 369 | p->connect = 0; |
370 | } | ||
371 | } | 370 | } |
372 | break; | 371 | break; |
373 | case snd_soc_dapm_virt_mux: { | 372 | case snd_soc_dapm_virt_mux: { |
@@ -397,11 +396,10 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
397 | break; | 396 | break; |
398 | } | 397 | } |
399 | 398 | ||
400 | p->connect = 0; | 399 | if (item < e->max && !strcmp(p->name, e->texts[item])) |
401 | for (i = 0; i < e->max; i++) { | 400 | p->connect = 1; |
402 | if (!(strcmp(p->name, e->texts[i])) && item == i) | 401 | else |
403 | p->connect = 1; | 402 | p->connect = 0; |
404 | } | ||
405 | } | 403 | } |
406 | break; | 404 | break; |
407 | /* does not affect routing - always connected */ | 405 | /* does not affect routing - always connected */ |