From 6735cf412e42e7cf3ce4e7372bd31d7eea7ff034 Mon Sep 17 00:00:00 2001 From: Tobias Johansson Date: Wed, 17 Nov 2021 14:16:56 +0100 Subject: [PATCH] drivers: audio: Don't stop cxd56 when stopped Avoid trying to stop the driver when already stopped. Signed-off-by: Tobias Johansson --- drivers/audio/cxd56.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/audio/cxd56.c b/drivers/audio/cxd56.c index 7cb9bb3fa1..6fd645d81a 100644 --- a/drivers/audio/cxd56.c +++ b/drivers/audio/cxd56.c @@ -1291,8 +1291,9 @@ static void _process_audio_with_src(cxd56_dmahandle_t hdl, uint16_t err_code) { /* Notify end of data */ - if (dev->state != CXD56_DEV_STATE_PAUSED - && dq_count(&dev->down_pendq) == 0) + if (dev->state != CXD56_DEV_STATE_PAUSED && + dev->state != CXD56_DEV_STATE_STOPPED && + dq_count(&dev->down_pendq) == 0) { msg.msg_id = AUDIO_MSG_STOP; msg.u.data = 0; @@ -1393,7 +1394,8 @@ static void _process_audio(cxd56_dmahandle_t hdl, uint16_t err_code) { /* Notify end of data */ - if (dev->state != CXD56_DEV_STATE_PAUSED) + if (dev->state != CXD56_DEV_STATE_PAUSED && + dev->state != CXD56_DEV_STATE_STOPPED) { audinfo("DMA_TRANS up_pendq=%d \n", dq_count(&dev->up_pendq));