Skip to content

Commit 00ba0a9

Browse files
committed
ASoC: wm_adsp: Take prefix into account in control name length
Change-Id: I301905aabada8adacee6b92f9935bf4d1260ac28 Signed-off-by: Charles Keepax <[email protected]>
1 parent 9f3fb25 commit 00ba0a9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sound/soc/codecs/wm_adsp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,9 +1713,13 @@ static int wm_adsp_create_control(struct wm_adsp *dsp,
17131713
}
17141714

17151715
if (subname) {
1716+
struct snd_soc_component *component = &dsp->codec->component;
17161717
int avail = SNDRV_CTL_ELEM_ID_NAME_MAXLEN - ret - 2;
17171718
int skip = 0;
17181719

1720+
if (component->name_prefix)
1721+
avail -= strlen(component->name_prefix) + 1;
1722+
17191723
/* Truncate the subname from the start if it is too long */
17201724
if (subname_len > avail)
17211725
skip = subname_len - avail;

0 commit comments

Comments
 (0)