aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/mixer.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/mixer.c')
-rw-r--r--sound/usb/mixer.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 3ed3901369ce..f2d74d654b3c 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -759,8 +759,6 @@ static void usb_mixer_elem_free(struct snd_kcontrol *kctl)
759 */ 759 */
760static int get_min_max(struct usb_mixer_elem_info *cval, int default_min) 760static int get_min_max(struct usb_mixer_elem_info *cval, int default_min)
761{ 761{
762 struct snd_usb_audio *chip = cval->mixer->chip;
763
764 /* for failsafe */ 762 /* for failsafe */
765 cval->min = default_min; 763 cval->min = default_min;
766 cval->max = cval->min + 1; 764 cval->max = cval->min + 1;
@@ -783,7 +781,7 @@ static int get_min_max(struct usb_mixer_elem_info *cval, int default_min)
783 if (get_ctl_value(cval, UAC_GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 || 781 if (get_ctl_value(cval, UAC_GET_MAX, (cval->control << 8) | minchn, &cval->max) < 0 ||
784 get_ctl_value(cval, UAC_GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) { 782 get_ctl_value(cval, UAC_GET_MIN, (cval->control << 8) | minchn, &cval->min) < 0) {
785 snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n", 783 snd_printd(KERN_ERR "%d:%d: cannot get min/max values for control %d (id %d)\n",
786 cval->id, snd_usb_ctrl_intf(chip), cval->control, cval->id); 784 cval->id, snd_usb_ctrl_intf(cval->mixer->chip), cval->control, cval->id);
787 return -EINVAL; 785 return -EINVAL;
788 } 786 }
789 if (get_ctl_value(cval, UAC_GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) { 787 if (get_ctl_value(cval, UAC_GET_RES, (cval->control << 8) | minchn, &cval->res) < 0) {
@@ -1642,9 +1640,10 @@ static int mixer_ctl_selector_info(struct snd_kcontrol *kcontrol, struct snd_ctl
1642 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; 1640 uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
1643 uinfo->count = 1; 1641 uinfo->count = 1;
1644 uinfo->value.enumerated.items = cval->max; 1642 uinfo->value.enumerated.items = cval->max;
1645 if ((int)uinfo->value.enumerated.item >= cval->max) 1643 if (uinfo->value.enumerated.item >= cval->max)
1646 uinfo->value.enumerated.item = cval->max - 1; 1644 uinfo->value.enumerated.item = cval->max - 1;
1647 strcpy(uinfo->value.enumerated.name, itemlist[uinfo->value.enumerated.item]); 1645 strlcpy(uinfo->value.enumerated.name, itemlist[uinfo->value.enumerated.item],
1646 sizeof(uinfo->value.enumerated.name));
1648 return 0; 1647 return 0;
1649} 1648}
1650 1649