mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
ALSA: usb-audio: scarlett2: Merge common line in capture strings
Use a common sprintf() format for the mixer element names generated in scarlett2_add_line_in_ctls() in preparation for more of them. Signed-off-by: Geoffrey D. Bennett <g@b4.vu> Link: https://lore.kernel.org/r/d91dce45ac75a541c21f47540ecbda24bd83f68c.1624294591.git.g@b4.vu Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
f3c6104301
commit
077e104e2e
1 changed files with 3 additions and 2 deletions
|
@ -1660,10 +1660,11 @@ static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer)
|
||||||
const struct scarlett2_device_info *info = private->info;
|
const struct scarlett2_device_info *info = private->info;
|
||||||
int err, i;
|
int err, i;
|
||||||
char s[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
char s[SNDRV_CTL_ELEM_ID_NAME_MAXLEN];
|
||||||
|
const char *fmt = "Line In %d %s Capture %s";
|
||||||
|
|
||||||
/* Add input level (line/inst) controls */
|
/* Add input level (line/inst) controls */
|
||||||
for (i = 0; i < info->level_input_count; i++) {
|
for (i = 0; i < info->level_input_count; i++) {
|
||||||
snprintf(s, sizeof(s), "Line In %d Level Capture Enum", i + 1);
|
snprintf(s, sizeof(s), fmt, i + 1, "Level", "Enum");
|
||||||
err = scarlett2_add_new_ctl(mixer, &scarlett2_level_enum_ctl,
|
err = scarlett2_add_new_ctl(mixer, &scarlett2_level_enum_ctl,
|
||||||
i, 1, s, NULL);
|
i, 1, s, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
@ -1672,7 +1673,7 @@ static int scarlett2_add_line_in_ctls(struct usb_mixer_interface *mixer)
|
||||||
|
|
||||||
/* Add input pad controls */
|
/* Add input pad controls */
|
||||||
for (i = 0; i < info->pad_input_count; i++) {
|
for (i = 0; i < info->pad_input_count; i++) {
|
||||||
snprintf(s, sizeof(s), "Line In %d Pad Capture Switch", i + 1);
|
snprintf(s, sizeof(s), fmt, i + 1, "Pad", "Switch");
|
||||||
err = scarlett2_add_new_ctl(mixer, &scarlett2_pad_ctl,
|
err = scarlett2_add_new_ctl(mixer, &scarlett2_pad_ctl,
|
||||||
i, 1, s, NULL);
|
i, 1, s, NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
|
|
Loading…
Reference in a new issue