[alsa-devel] [PATCH 1/2 v6] ALSA: usb-audio: Add mixer control for Digidesign Mbox 1 clock source

Takashi Iwai tiwai at suse.de
Tue Nov 11 08:20:05 CET 2014


At Tue, 11 Nov 2014 11:20:16 +1100,
Damien Zammit wrote:
> 
> +static int snd_mbox1_switch_put(struct snd_kcontrol *kctl,
> +				struct snd_ctl_elem_value *ucontrol)
> +{
> +	struct snd_usb_audio *chip;
> +	struct usb_mixer_interface *mixer;
> +	int err;
> +	bool cur_val, new_val;
> +	unsigned char buff[3];
> +
> +	cur_val = kctl->private_value;
> +	new_val = ucontrol->value.enumerated.item[0];
> +
> +	mixer = snd_kcontrol_chip(kctl);
> +	if (snd_BUG_ON(!mixer))
> +		return -EINVAL;
> +
> +	chip = mixer->chip;
> +	if (snd_BUG_ON(!chip))
> +		return -EINVAL;
> +
> +	if (cur_val != new_val)
> +		return 0;

This should be "cur_val == new_val" (no change, just return).


Takashi


More information about the Alsa-devel mailing list