[alsa-devel] [PATCH] ALSA: usb-audio: correct the value cache check.

Takashi Iwai tiwai at suse.de
Fri Aug 28 10:47:22 CEST 2015


On Fri, 28 Aug 2015 10:33:25 +0200,
Yao-Wen Mao wrote:
> 
> The check of cval->cached should be zero-based (including master channel).
> 
> Signed-off-by: Yao-Wen Mao <yaowen at google.com>

A good catch.  Applied now, thanks.


Takashi

> ---
>  sound/usb/mixer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index fd5c49e..f494dce 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -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)
> -- 
> 2.5.0.457.gab17608
> 
> 


More information about the Alsa-devel mailing list