Commit 68a653ab authored by Vijendar Mukunda's avatar Vijendar Mukunda Committed by Mark Brown

ASoC: amd: ps: fix byte count return value for invalid SoundWire manager instance

acp_get_byte_count() function should return zero bytes instead of
-EINVAL for invalid SoundWire manager instance.

Fixes: f7229173 ("ASoC: amd: ps: add SoundWire dma driver dma ops")
Signed-off-by: default avatarVijendar Mukunda <Vijendar.Mukunda@amd.com>
Link: https://lore.kernel.org/r/20230626105356.2580125-5-Vijendar.Mukunda@amd.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 46b50e51
...@@ -318,12 +318,13 @@ static u64 acp63_sdw_get_byte_count(struct acp_sdw_dma_stream *stream, void __io ...@@ -318,12 +318,13 @@ static u64 acp63_sdw_get_byte_count(struct acp_sdw_dma_stream *stream, void __io
pos_high_reg = sdw1_dma_ring_buf_reg[stream->stream_id].pos_high_reg; pos_high_reg = sdw1_dma_ring_buf_reg[stream->stream_id].pos_high_reg;
break; break;
default: default:
return -EINVAL; goto POINTER_RETURN_BYTES;
} }
if (pos_low_reg) { if (pos_low_reg) {
byte_count.bcount.high = readl(acp_base + pos_high_reg); byte_count.bcount.high = readl(acp_base + pos_high_reg);
byte_count.bcount.low = readl(acp_base + pos_low_reg); byte_count.bcount.low = readl(acp_base + pos_low_reg);
} }
POINTER_RETURN_BYTES:
return byte_count.bytescount; return byte_count.bytescount;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment