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>
This commit is contained in:
@@ -2685,7 +2685,7 @@ static struct snd_kcontrol_new *
|
||||
stac_control_new(struct sigmatel_spec *spec,
|
||||
struct snd_kcontrol_new *ktemp,
|
||||
const char *name,
|
||||
hda_nid_t nid)
|
||||
unsigned int subdev)
|
||||
{
|
||||
struct snd_kcontrol_new *knew;
|
||||
|
||||
@@ -2701,9 +2701,7 @@ stac_control_new(struct sigmatel_spec *spec,
|
||||
spec->kctls.alloced--;
|
||||
return NULL;
|
||||
}
|
||||
if (nid)
|
||||
knew->subdevice = HDA_SUBDEV_NID_FLAG |
|
||||
HDA_SUBDEV_AMP_FLAG | nid;
|
||||
knew->subdevice = subdev;
|
||||
return knew;
|
||||
}
|
||||
|
||||
@@ -2713,7 +2711,7 @@ static int stac92xx_add_control_temp(struct sigmatel_spec *spec,
|
||||
unsigned long val)
|
||||
{
|
||||
struct snd_kcontrol_new *knew = stac_control_new(spec, ktemp, name,
|
||||
get_amp_nid_(val));
|
||||
HDA_SUBDEV_AMP_FLAG);
|
||||
if (!knew)
|
||||
return -ENOMEM;
|
||||
knew->index = idx;
|
||||
|
Reference in New Issue
Block a user