From: Ian Armstrong Date: Sat, 11 Oct 2008 09:39:05 +0000 (-0300) Subject: V4L/DVB (9190): ivtv: yuv write() error handling tweak X-Git-Tag: v2.6.28-rc1~256^2~94 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2e668962a54b64f3daffb8eef3ca538e25324d1a;p=platform%2Fkernel%2Flinux-3.10.git V4L/DVB (9190): ivtv: yuv write() error handling tweak Modifies behaviour of a failed dma write() operation for the yuv device. If the dma transfer for the yuv device fails, the write() operation will now exit immediately. Signed-off-by: Ian Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index b7457fc..1c404e4 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c @@ -600,13 +600,14 @@ retry: since we may get here before the stream has been fully set-up */ if (mode == OUT_YUV && s->q_full.length == 0 && itv->dma_data_req_size) { while (count >= itv->dma_data_req_size) { - if (!ivtv_yuv_udma_stream_frame (itv, (void __user *)user_buf)) { - bytes_written += itv->dma_data_req_size; - user_buf += itv->dma_data_req_size; - count -= itv->dma_data_req_size; - } else { - break; - } + rc = ivtv_yuv_udma_stream_frame(itv, (void __user *)user_buf); + + if (rc < 0) + return rc; + + bytes_written += itv->dma_data_req_size; + user_buf += itv->dma_data_req_size; + count -= itv->dma_data_req_size; } if (count == 0) { IVTV_DEBUG_HI_FILE("Wrote %d bytes to %s (%d)\n", bytes_written, s->name, s->q_full.bytesused);