Commit 43cff73
committed
firmware: cs_dsp: Ensure cs_dsp_load[_coeff]() returns 0 on success
JIRA: https://issues.redhat.com/browse/RHEL-80682
commit 2593f7e
Author: Richard Fitzgerald <rf@opensource.cirrus.com>
Date: Sun Mar 23 17:05:29 2025 +0000
firmware: cs_dsp: Ensure cs_dsp_load[_coeff]() returns 0 on success
Set ret = 0 on successful completion of the processing loop in
cs_dsp_load() and cs_dsp_load_coeff() to ensure that the function
returns 0 on success.
All normal firmware files will have at least one data block, and
processing this block will set ret == 0, from the result of either
regmap_raw_write() or cs_dsp_parse_coeff().
The kunit tests create a dummy firmware file that contains only the
header, without any data blocks. This gives cs_dsp a file to "load"
that will not cause any side-effects. As there aren't any data blocks,
the processing loop will not set ret == 0.
Originally there was a line after the processing loop:
ret = regmap_async_complete(regmap);
which would set ret == 0 before the function returned.
Commit fe08b7d ("firmware: cs_dsp: Remove async regmap writes")
changed the regmap write to a normal sync write, so the call to
regmap_async_complete() wasn't necessary and was removed. It was
overlooked that the ret here wasn't only to check the result of
regmap_async_complete(), it also set the final return value of the
function.
Fixes: fe08b7d ("firmware: cs_dsp: Remove async regmap writes")
Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Link: https://patch.msgid.link/20250323170529.197205-1-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Jaroslav Kysela <jkysela@redhat.com>1 parent 6227d68 commit 43cff73
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1631 | 1631 | | |
1632 | 1632 | | |
1633 | 1633 | | |
| 1634 | + | |
1634 | 1635 | | |
1635 | 1636 | | |
1636 | 1637 | | |
| |||
2338 | 2339 | | |
2339 | 2340 | | |
2340 | 2341 | | |
| 2342 | + | |
2341 | 2343 | | |
2342 | 2344 | | |
2343 | 2345 | | |
| |||
0 commit comments