aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/hda/patch_sigmatel.c
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@perex.cz>2009-12-10 07:57:01 -0500
committerJaroslav Kysela <perex@perex.cz>2009-12-15 03:33:32 -0500
commit5e26dfd0615868872cb44842f1e1428c7b414ab0 (patch)
tree75472db826d948edde152969045a819653ac54b3 /sound/pci/hda/patch_sigmatel.c
parent9e3fd8719f624a43575b56a4777b1552399a8be8 (diff)
ALSA: hda - simplify usage of HDA_SUBDEV_AMP_FLAG
The HDA_SUBDEV_NID_FLAG is duplicate for amplifier control elements. Move get_amp_nid_() call to the snd_hda_ctl_add() function. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/hda/patch_sigmatel.c')
-rw-r--r--sound/pci/hda/patch_sigmatel.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 1ee586b65b63..0bafea9d5106 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -2685,7 +2685,7 @@ static struct snd_kcontrol_new *
2685stac_control_new(struct sigmatel_spec *spec, 2685stac_control_new(struct sigmatel_spec *spec,
2686 struct snd_kcontrol_new *ktemp, 2686 struct snd_kcontrol_new *ktemp,
2687 const char *name, 2687 const char *name,
2688 hda_nid_t nid) 2688 unsigned int subdev)
2689{ 2689{
2690 struct snd_kcontrol_new *knew; 2690 struct snd_kcontrol_new *knew;
2691 2691
@@ -2701,9 +2701,7 @@ stac_control_new(struct sigmatel_spec *spec,
2701 spec->kctls.alloced--; 2701 spec->kctls.alloced--;
2702 return NULL; 2702 return NULL;
2703 } 2703 }
2704 if (nid) 2704 knew->subdevice = subdev;
2705 knew->subdevice = HDA_SUBDEV_NID_FLAG |
2706 HDA_SUBDEV_AMP_FLAG | nid;
2707 return knew; 2705 return knew;
2708} 2706}
2709 2707
@@ -2713,7 +2711,7 @@ static int stac92xx_add_control_temp(struct sigmatel_spec *spec,
2713 unsigned long val) 2711 unsigned long val)
2714{ 2712{
2715 struct snd_kcontrol_new *knew = stac_control_new(spec, ktemp, name, 2713 struct snd_kcontrol_new *knew = stac_control_new(spec, ktemp, name,
2716 get_amp_nid_(val)); 2714 HDA_SUBDEV_AMP_FLAG);
2717 if (!knew) 2715 if (!knew)
2718 return -ENOMEM; 2716 return -ENOMEM;
2719 knew->index = idx; 2717 knew->index = idx;