diff mbox series

[v2,08/18] ASoC: SOF: topology: Modify the get_token op for string tokens

Message ID 20220308164344.577647-9-ranjani.sridharan@linux.intel.com (mailing list archive)
State Accepted
Commit 5ef969e2f8e199d8881ea4cd78cb86df1c67d92b
Headers show
Series Clean ups and preparation for IPC abstraction in the SOF driver | expand

Commit Message

Ranjani Sridharan March 8, 2022, 4:43 p.m. UTC
Modify the get_token op for string type tokens to pass the string as the
argument instead of a pointer to struct snd_soc_tplg_vendor_string_elem.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/sof/topology.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c
index 7280e14c13bc..4ba46ea73c8a 100644
--- a/sound/soc/sof/topology.c
+++ b/sound/soc/sof/topology.c
@@ -507,28 +507,25 @@  static int get_token_uuid(void *elem, void *object, u32 offset)
 
 static int get_token_comp_format(void *elem, void *object, u32 offset)
 {
-	struct snd_soc_tplg_vendor_string_elem *velem = elem;
 	u32 *val = (u32 *)((u8 *)object + offset);
 
-	*val = find_format(velem->string);
+	*val = find_format((const char *)elem);
 	return 0;
 }
 
 static int get_token_dai_type(void *elem, void *object, u32 offset)
 {
-	struct snd_soc_tplg_vendor_string_elem *velem = elem;
 	u32 *val = (u32 *)((u8 *)object + offset);
 
-	*val = find_dai(velem->string);
+	*val = find_dai((const char *)elem);
 	return 0;
 }
 
 static int get_token_process_type(void *elem, void *object, u32 offset)
 {
-	struct snd_soc_tplg_vendor_string_elem *velem = elem;
 	u32 *val = (u32 *)((u8 *)object + offset);
 
-	*val = find_process(velem->string);
+	*val = find_process((const char *)elem);
 	return 0;
 }
 
@@ -872,8 +869,7 @@  static int sof_parse_string_tokens(struct snd_soc_component *scomp,
 				continue;
 
 			/* matched - now load token */
-			tokens[j].get_token(elem, object,
-					    offset + tokens[j].offset);
+			tokens[j].get_token(elem->string, object, offset + tokens[j].offset);
 
 			found++;
 		}