mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 07:38:10 +00:00
ASoC: mchp-spdifrx: fix return value in case completion times out
wait_for_completion_interruptible_timeout() returns 0 in case of
timeout. Check this into account when returning from function.
Fixes: ef265c55c1
("ASoC: mchp-spdifrx: add driver for SPDIF RX")
Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Link: https://lore.kernel.org/r/20230130120647.638049-3-claudiu.beznea@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
fa09fa6038
commit
a4c4161d6e
1 changed files with 3 additions and 2 deletions
|
@ -524,9 +524,10 @@ static int mchp_spdifrx_cs_get(struct mchp_spdifrx_dev *dev,
|
|||
ret = wait_for_completion_interruptible_timeout(&ch_stat->done,
|
||||
msecs_to_jiffies(100));
|
||||
/* IP might not be started or valid stream might not be present */
|
||||
if (ret < 0) {
|
||||
if (ret <= 0) {
|
||||
dev_dbg(dev->dev, "channel status for channel %d timeout\n",
|
||||
channel);
|
||||
return ret ? : -ETIMEDOUT;
|
||||
}
|
||||
|
||||
memcpy(uvalue->value.iec958.status, ch_stat->data,
|
||||
|
@ -580,7 +581,7 @@ static int mchp_spdifrx_subcode_ch_get(struct mchp_spdifrx_dev *dev,
|
|||
dev_dbg(dev->dev, "user data for channel %d timeout\n",
|
||||
channel);
|
||||
mchp_spdifrx_isr_blockend_dis(dev);
|
||||
return ret;
|
||||
return ret ? : -ETIMEDOUT;
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&user_data->lock, flags);
|
||||
|
|
Loading…
Reference in a new issue