--- zzzz-none-000/linux-3.10.107/sound/usb/6fire/control.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/sound/usb/6fire/control.c 2021-02-04 17:41:59.000000000 +0000 @@ -25,8 +25,8 @@ #include "comm.h" #include "chip.h" -static char *opt_coax_texts[2] = { "Optical", "Coax" }; -static char *line_phono_texts[2] = { "Line", "Phono" }; +static const char * const opt_coax_texts[2] = { "Optical", "Coax" }; +static const char * const line_phono_texts[2] = { "Line", "Phono" }; /* * data that needs to be sent to device. sets up card internal stuff. @@ -194,7 +194,8 @@ int changed = 0; if (ch > 4) { - snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); + dev_err(&rt->chip->dev->dev, + "Invalid channel in volume control."); return -EINVAL; } @@ -222,7 +223,8 @@ unsigned int ch = kcontrol->private_value; if (ch > 4) { - snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); + dev_err(&rt->chip->dev->dev, + "Invalid channel in volume control."); return -EINVAL; } @@ -240,7 +242,8 @@ u8 value = 0; if (ch > 4) { - snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); + dev_err(&rt->chip->dev->dev, + "Invalid channel in volume control."); return -EINVAL; } @@ -265,7 +268,8 @@ u8 value = rt->output_mute >> ch; if (ch > 4) { - snd_printk(KERN_ERR PREFIX "Invalid channel in volume control."); + dev_err(&rt->chip->dev->dev, + "Invalid channel in volume control."); return -EINVAL; } @@ -323,14 +327,7 @@ static int usb6fire_control_line_phono_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 2; - if (uinfo->value.enumerated.item > 1) - uinfo->value.enumerated.item = 1; - strcpy(uinfo->value.enumerated.name, - line_phono_texts[uinfo->value.enumerated.item]); - return 0; + return snd_ctl_enum_info(uinfo, 1, 2, line_phono_texts); } static int usb6fire_control_line_phono_put(struct snd_kcontrol *kcontrol, @@ -357,14 +354,7 @@ static int usb6fire_control_opt_coax_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { - uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; - uinfo->count = 1; - uinfo->value.enumerated.items = 2; - if (uinfo->value.enumerated.item > 1) - uinfo->value.enumerated.item = 1; - strcpy(uinfo->value.enumerated.name, - opt_coax_texts[uinfo->value.enumerated.item]); - return 0; + return snd_ctl_enum_info(uinfo, 1, 2, opt_coax_texts); } static int usb6fire_control_opt_coax_put(struct snd_kcontrol *kcontrol, @@ -594,14 +584,14 @@ ret = usb6fire_control_add_virtual(rt, chip->card, "Master Playback Volume", vol_elements); if (ret) { - snd_printk(KERN_ERR PREFIX "cannot add control.\n"); + dev_err(&chip->dev->dev, "cannot add control.\n"); kfree(rt); return ret; } ret = usb6fire_control_add_virtual(rt, chip->card, "Master Playback Switch", mute_elements); if (ret) { - snd_printk(KERN_ERR PREFIX "cannot add control.\n"); + dev_err(&chip->dev->dev, "cannot add control.\n"); kfree(rt); return ret; } @@ -611,7 +601,7 @@ ret = snd_ctl_add(chip->card, snd_ctl_new1(&elements[i], rt)); if (ret < 0) { kfree(rt); - snd_printk(KERN_ERR PREFIX "cannot add control.\n"); + dev_err(&chip->dev->dev, "cannot add control.\n"); return ret; } i++;