Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <shenghao-ding@ti.com>
Link: https://patch.msgid.link/20240705064846.1723-1-shenghao-ding@ti.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Shenghao Ding and committed by
Mark Brown
ccb367c5 fc800b84

+6 -24
+6 -24
sound/soc/codecs/pcm6240.c
··· 58 58 "%s i2c%d Dev%d Ch%d Fine Volume", 59 59 }; 60 60 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 - 67 61 static const struct pcmdevice_mixer_control adc5120_analog_gain_ctl[] = { 68 62 { 69 63 .shift = 1, ··· 1360 1366 1361 1367 name_id = pcmdev_gain_ctl_info[id][ctl_id].pcmdev_ctrl_name_id; 1362 1368 1363 - if (comp->name_prefix) 1364 - ctrl_name = pcmdev_ctrl_name_with_prefix[name_id]; 1365 - else 1366 - ctrl_name = pcmdev_ctrl_name[name_id]; 1369 + ctrl_name = pcmdev_ctrl_name[name_id]; 1367 1370 1368 1371 for (chn = 1; chn <= nr_chn; chn++) { 1369 1372 name = devm_kzalloc(pcm_dev->dev, ··· 1369 1378 ret = -ENOMEM; 1370 1379 goto out; 1371 1380 } 1372 - if (comp->name_prefix) 1373 - scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, 1374 - ctrl_name, comp->name_prefix, dev_no, chn); 1375 - else 1376 - scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, 1377 - ctrl_name, pcm_dev->upper_dev_name, adap->nr, 1378 - dev_no, chn); 1381 + scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, 1382 + ctrl_name, pcm_dev->upper_dev_name, adap->nr, 1383 + dev_no, chn); 1379 1384 pcmdev_controls[mix_index].tlv.p = 1380 1385 pcmdev_gain_ctl_info[id][ctl_id].gain; 1381 1386 pcmdev_ctrl = devm_kmemdup(pcm_dev->dev, ··· 1425 1438 if (!name) 1426 1439 return -ENOMEM; 1427 1440 1428 - if (comp->name_prefix) 1429 - scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, 1430 - "%s Profile id", comp->name_prefix); 1431 - else 1432 - scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, 1433 - "%s i2c%d Profile id", pcm_dev->upper_dev_name, 1434 - adap->nr); 1441 + scnprintf(name, SNDRV_CTL_ELEM_ID_NAME_MAXLEN, 1442 + "%s i2c%d Profile id", pcm_dev->upper_dev_name, adap->nr); 1435 1443 pcmdev_ctrl->name = name; 1436 1444 pcmdev_ctrl->iface = SNDRV_CTL_ELEM_IFACE_MIXER; 1437 1445 pcmdev_ctrl->info = pcmdevice_info_profile;