Commit 2e668962 authored by Ian Armstrong's avatar Ian Armstrong Committed by Mauro Carvalho Chehab

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: default avatarIan Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 26e9a397
...@@ -600,13 +600,14 @@ ssize_t ivtv_v4l2_write(struct file *filp, const char __user *user_buf, size_t c ...@@ -600,13 +600,14 @@ ssize_t ivtv_v4l2_write(struct file *filp, const char __user *user_buf, size_t c
since we may get here before the stream has been fully set-up */ 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) { if (mode == OUT_YUV && s->q_full.length == 0 && itv->dma_data_req_size) {
while (count >= itv->dma_data_req_size) { while (count >= itv->dma_data_req_size) {
if (!ivtv_yuv_udma_stream_frame (itv, (void __user *)user_buf)) { rc = ivtv_yuv_udma_stream_frame(itv, (void __user *)user_buf);
bytes_written += itv->dma_data_req_size;
user_buf += itv->dma_data_req_size; if (rc < 0)
count -= itv->dma_data_req_size; return rc;
} else {
break; bytes_written += itv->dma_data_req_size;
} user_buf += itv->dma_data_req_size;
count -= itv->dma_data_req_size;
} }
if (count == 0) { if (count == 0) {
IVTV_DEBUG_HI_FILE("Wrote %d bytes to %s (%d)\n", bytes_written, s->name, s->q_full.bytesused); IVTV_DEBUG_HI_FILE("Wrote %d bytes to %s (%d)\n", bytes_written, s->name, s->q_full.bytesused);
......
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