Commit ccb367c5 authored by Shenghao Ding's avatar Shenghao Ding Committed by Mark Brown

ASoc: pcm6240: Remove unnecessary name-prefix for all the controls

Adding name-prefix for each audio controls is a redundant, because
name-prefix will be automatically added behind the control name when
creating a new control.
Signed-off-by: default avatarShenghao Ding <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240705064846.1723-1-shenghao-ding@ti.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent fc800b84
...@@ -58,12 +58,6 @@ static const char *const pcmdev_ctrl_name[] = { ...@@ -58,12 +58,6 @@ static const char *const pcmdev_ctrl_name[] = {
"%s i2c%d Dev%d Ch%d Fine Volume", "%s i2c%d Dev%d Ch%d Fine Volume",
}; };
static const char *const pcmdev_ctrl_name_with_prefix[] = {
"%s Dev%d Ch%d Ana Volume",
"%s Dev%d Ch%d Digi Volume",
"%s Dev%d Ch%d Fine Volume",
};
static const struct pcmdevice_mixer_control adc5120_analog_gain_ctl[] = { static const struct pcmdevice_mixer_control adc5120_analog_gain_ctl[] = {
{ {
.shift = 1, .shift = 1,
...@@ -1366,10 +1360,7 @@ static int pcmdev_gain_ctrl_add(struct pcmdevice_priv *pcm_dev, ...@@ -1366,10 +1360,7 @@ static int pcmdev_gain_ctrl_add(struct pcmdevice_priv *pcm_dev,
name_id = pcmdev_gain_ctl_info[id][ctl_id].pcmdev_ctrl_name_id; name_id = pcmdev_gain_ctl_info[id][ctl_id].pcmdev_ctrl_name_id;
if (comp->name_prefix) ctrl_name = pcmdev_ctrl_name[name_id];
ctrl_name = pcmdev_ctrl_name_with_prefix[name_id];
else
ctrl_name = pcmdev_ctrl_name[name_id];
for (chn = 1; chn <= nr_chn; chn++) { for (chn = 1; chn <= nr_chn; chn++) {
name = devm_kzalloc(pcm_dev->dev, name = devm_kzalloc(pcm_dev->dev,
...@@ -1378,13 +1369,9 @@ static int pcmdev_gain_ctrl_add(struct pcmdevice_priv *pcm_dev, ...@@ -1378,13 +1369,9 @@ static int pcmdev_gain_ctrl_add(struct pcmdevice_priv *pcm_dev,
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
if (comp->name_prefix) scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, ctrl_name, pcm_dev->upper_dev_name, adap->nr,
ctrl_name, comp->name_prefix, dev_no, chn); dev_no, chn);
else
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
ctrl_name, pcm_dev->upper_dev_name, adap->nr,
dev_no, chn);
pcmdev_controls[mix_index].tlv.p = pcmdev_controls[mix_index].tlv.p =
pcmdev_gain_ctl_info[id][ctl_id].gain; pcmdev_gain_ctl_info[id][ctl_id].gain;
pcmdev_ctrl = devm_kmemdup(pcm_dev->dev, pcmdev_ctrl = devm_kmemdup(pcm_dev->dev,
...@@ -1438,13 +1425,8 @@ static int pcmdev_profile_ctrl_add(struct pcmdevice_priv *pcm_dev) ...@@ -1438,13 +1425,8 @@ static int pcmdev_profile_ctrl_add(struct pcmdevice_priv *pcm_dev)
if (!name) if (!name)
return -ENOMEM; return -ENOMEM;
if (comp->name_prefix) scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, "%s i2c%d Profile id", pcm_dev->upper_dev_name, adap->nr);
"%s Profile id", comp->name_prefix);
else
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
"%s i2c%d Profile id", pcm_dev->upper_dev_name,
adap->nr);
pcmdev_ctrl->name = name; pcmdev_ctrl->name = name;
pcmdev_ctrl->iface = SNDRV_CTL_ELEM_IFACE_MIXER; pcmdev_ctrl->iface = SNDRV_CTL_ELEM_IFACE_MIXER;
pcmdev_ctrl->info = pcmdevice_info_profile; pcmdev_ctrl->info = pcmdevice_info_profile;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment