From: Hugues Fruchet Date: Mon, 11 Jun 2018 09:50:25 +0000 (-0400) Subject: media: stm32-dcmi: return buffer in error state on dma error X-Git-Tag: v4.19~407^2~375 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a331df3cb3a121ed9d6c2010f28ca0fccc4153ba;p=platform%2Fkernel%2Flinux-rpi.git media: stm32-dcmi: return buffer in error state on dma error Return buffer to V4L2 in error state if DMA error occurs. Signed-off-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index fc72a57d8478..526d8311df4a 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -261,6 +261,9 @@ static void dcmi_dma_callback(void *param) break; case DMA_ERROR: dev_err(dcmi->dev, "%s: Received DMA_ERROR\n", __func__); + + /* Return buffer to V4L2 in error state */ + dcmi_buffer_done(dcmi, buf, 0, -EIO); break; case DMA_COMPLETE: dev_dbg(dcmi->dev, "%s: Received DMA_COMPLETE\n", __func__);