ALSA: usb-audio: correct the value cache check.
PATCH 1/1 ALSA: usb-audio: correct the value cache check.
The check of cval->cached should be zero-based (including master channel).
Signed-off-by Yao-Wen Mao <[email protected]>
--- sound/usb/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/mixer.c +1 -1
@@ -2540,7 +2540,7 @@ static int restore_mixer_value(struct usb_mixer_elem_list *list)for (c =0 ; c <MAX_CHANNELS ; c++) {if (!(cval->cmask & (1 << c)))continue ; -if (cval->cached & (1 << c)) { +if (cval->cached & (1 << (c +1 ))) { err =snd_usb_set_cur_mix_value (cval, c +1 , idx, cval->cache_val[idx]);if (err <0 )
Signature · 1 line
2.5.0.457.gab17608
Quoted 4 lines · Yao-Wen Mao
The check of
cval->cachedshould be zero-based (including master channel).Signed-off-by Yao-Wen Mao <[email protected]>
A good catch. Applied now, thanks.
Takashi
Quoted 21 lines
--- sound/usb/mixer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)sound/usb/mixer.c +1
-1@@ -2540,7 +2540,7 @@ static int restore_mixer_value(struct usb_mixer_elem_list *list)for (c =0 ; c <MAX_CHANNELS ; c++) {if (!(cval->cmask & (1 << c)))continue ; -if (cval->cached & (1 << c)) { +if (cval->cached & (1 << (c +1 ))) { err =snd_usb_set_cur_mix_value (cval, c +1 , idx, cval->cache_val[idx]);if (err <0 )Signature · 1 line
2.5.0.457.gab17608