Skip to content

Commit ccb367c

Browse files
Shenghao-Dingbroonie
authored andcommitted
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: Shenghao Ding <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent fc800b8 commit ccb367c

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

sound/soc/codecs/pcm6240.c

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,6 @@ static const char *const pcmdev_ctrl_name[] = {
5858
"%s i2c%d Dev%d Ch%d Fine Volume",
5959
};
6060

61-
static const char *const pcmdev_ctrl_name_with_prefix[] = {
62-
"%s Dev%d Ch%d Ana Volume",
63-
"%s Dev%d Ch%d Digi Volume",
64-
"%s Dev%d Ch%d Fine Volume",
65-
};
66-
6761
static const struct pcmdevice_mixer_control adc5120_analog_gain_ctl[] = {
6862
{
6963
.shift = 1,
@@ -1366,10 +1360,7 @@ static int pcmdev_gain_ctrl_add(struct pcmdevice_priv *pcm_dev,
13661360

13671361
name_id = pcmdev_gain_ctl_info[id][ctl_id].pcmdev_ctrl_name_id;
13681362

1369-
if (comp->name_prefix)
1370-
ctrl_name = pcmdev_ctrl_name_with_prefix[name_id];
1371-
else
1372-
ctrl_name = pcmdev_ctrl_name[name_id];
1363+
ctrl_name = pcmdev_ctrl_name[name_id];
13731364

13741365
for (chn = 1; chn <= nr_chn; chn++) {
13751366
name = devm_kzalloc(pcm_dev->dev,
@@ -1378,13 +1369,9 @@ static int pcmdev_gain_ctrl_add(struct pcmdevice_priv *pcm_dev,
13781369
ret = -ENOMEM;
13791370
goto out;
13801371
}
1381-
if (comp->name_prefix)
1382-
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
1383-
ctrl_name, comp->name_prefix, dev_no, chn);
1384-
else
1385-
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
1386-
ctrl_name, pcm_dev->upper_dev_name, adap->nr,
1387-
dev_no, chn);
1372+
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
1373+
ctrl_name, pcm_dev->upper_dev_name, adap->nr,
1374+
dev_no, chn);
13881375
pcmdev_controls[mix_index].tlv.p =
13891376
pcmdev_gain_ctl_info[id][ctl_id].gain;
13901377
pcmdev_ctrl = devm_kmemdup(pcm_dev->dev,
@@ -1438,13 +1425,8 @@ static int pcmdev_profile_ctrl_add(struct pcmdevice_priv *pcm_dev)
14381425
if (!name)
14391426
return -ENOMEM;
14401427

1441-
if (comp->name_prefix)
1442-
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
1443-
"%s Profile id", comp->name_prefix);
1444-
else
1445-
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
1446-
"%s i2c%d Profile id", pcm_dev->upper_dev_name,
1447-
adap->nr);
1428+
scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN,
1429+
"%s i2c%d Profile id", pcm_dev->upper_dev_name, adap->nr);
14481430
pcmdev_ctrl->name = name;
14491431
pcmdev_ctrl->iface = SNDRV_CTL_ELEM_IFACE_MIXER;
14501432
pcmdev_ctrl->info = pcmdevice_info_profile;

0 commit comments

Comments
 (0)