summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/aw88395/aw88395_device.c
diff options
context:
space:
mode:
authorWeidong Wang <wangweidong.a@awinic.com>2023-09-28 18:57:22 +0800
committerMark Brown <broonie@kernel.org>2023-09-28 13:38:33 +0200
commite83219c94abb4ad977f6b2b8be7d466ef0c2248f (patch)
tree31ed33471146e0b2b599352c45556b1c64e26815 /sound/soc/codecs/aw88395/aw88395_device.c
parent74ff4f22d81e97b5c2505cee2ff743fc9249d9e2 (diff)
ASoC: codecs: Modify the transmission method of parameters
Change the transmission mode of the "aw88395_dev_get_prof_name" function parameter, Instead of using return values for data transfer, parameters are used Signed-off-by: Weidong Wang <wangweidong.a@awinic.com> Link: https://lore.kernel.org/r/20230928105727.47273-6-wangweidong.a@awinic.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/aw88395/aw88395_device.c')
-rw-r--r--sound/soc/codecs/aw88395/aw88395_device.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sound/soc/codecs/aw88395/aw88395_device.c b/sound/soc/codecs/aw88395/aw88395_device.c
index 5ca4172cb788..fd1f67d5f22f 100644
--- a/sound/soc/codecs/aw88395/aw88395_device.c
+++ b/sound/soc/codecs/aw88395/aw88395_device.c
@@ -1296,7 +1296,9 @@ int aw88395_dev_fw_update(struct aw_device *aw_dev, bool up_dsp_fw_en, bool forc
return -EPERM;
}
- prof_name = aw88395_dev_get_prof_name(aw_dev, aw_dev->prof_index);
+ ret = aw88395_dev_get_prof_name(aw_dev, aw_dev->prof_index, &prof_name);
+ if (ret)
+ return ret;
dev_dbg(aw_dev->dev, "start update %s", prof_name);
@@ -1644,7 +1646,7 @@ int aw88395_dev_set_profile_index(struct aw_device *aw_dev, int index)
}
EXPORT_SYMBOL_GPL(aw88395_dev_set_profile_index);
-char *aw88395_dev_get_prof_name(struct aw_device *aw_dev, int index)
+int aw88395_dev_get_prof_name(struct aw_device *aw_dev, int index, char **prof_name)
{
struct aw_prof_info *prof_info = &aw_dev->prof_info;
struct aw_prof_desc *prof_desc;
@@ -1652,12 +1654,14 @@ char *aw88395_dev_get_prof_name(struct aw_device *aw_dev, int index)
if ((index >= aw_dev->prof_info.count) || (index < 0)) {
dev_err(aw_dev->dev, "index[%d] overflow count[%d]",
index, aw_dev->prof_info.count);
- return NULL;
+ return -EINVAL;
}
prof_desc = &aw_dev->prof_info.prof_desc[index];
- return prof_info->prof_name_list[prof_desc->id];
+ *prof_name = prof_info->prof_name_list[prof_desc->id];
+
+ return 0;
}
EXPORT_SYMBOL_GPL(aw88395_dev_get_prof_name);