Skip to content

Commit

Permalink
ALSA: bt87x: use enum control info helper
Browse files Browse the repository at this point in the history
Simplify the info callback by using the snd_ctl_enum_info() helper function.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Jan 10, 2011
1 parent 9600732 commit dd1224a
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sound/pci/bt87x.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,15 +637,9 @@ static struct snd_kcontrol_new snd_bt87x_capture_boost = {
static int snd_bt87x_capture_source_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *info)
{
static char *texts[3] = {"TV Tuner", "FM", "Mic/Line"};
static const char *const texts[3] = {"TV Tuner", "FM", "Mic/Line"};

info->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
info->count = 1;
info->value.enumerated.items = 3;
if (info->value.enumerated.item > 2)
info->value.enumerated.item = 2;
strcpy(info->value.enumerated.name, texts[info->value.enumerated.item]);
return 0;
return snd_ctl_enum_info(info, 1, 3, texts);
}

static int snd_bt87x_capture_source_get(struct snd_kcontrol *kcontrol,
Expand Down

0 comments on commit dd1224a

Please sign in to comment.