Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c69a637b authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hdspm: Use snd_ctl_enum_info()



... and reduce the open codes.

Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 8d678da9
Loading
Loading
Loading
Loading
+1 −12
Original line number Original line Diff line number Diff line
@@ -2645,18 +2645,7 @@ static int hdspm_set_clock_source(struct hdspm * hdspm, int mode)
static int snd_hdspm_info_clock_source(struct snd_kcontrol *kcontrol,
static int snd_hdspm_info_clock_source(struct snd_kcontrol *kcontrol,
				       struct snd_ctl_elem_info *uinfo)
				       struct snd_ctl_elem_info *uinfo)
{
{
	uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
	return snd_ctl_enum_info(uinfo, 1, 9, texts_freq + 1);
	uinfo->count = 1;
	uinfo->value.enumerated.items = 9;

	if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
		uinfo->value.enumerated.item =
		    uinfo->value.enumerated.items - 1;

	strcpy(uinfo->value.enumerated.name,
	       texts_freq[uinfo->value.enumerated.item+1]);

	return 0;
}
}


static int snd_hdspm_get_clock_source(struct snd_kcontrol *kcontrol,
static int snd_hdspm_get_clock_source(struct snd_kcontrol *kcontrol,