diff options
author | Ian Armstrong <ian@iarmst.demon.co.uk> | 2008-10-11 05:39:05 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-17 16:13:58 -0400 |
commit | 2e668962a54b64f3daffb8eef3ca538e25324d1a (patch) | |
tree | fbf2c520adf116ce0b4929ecb0d40fb9a59cf0ea /drivers/media | |
parent | 26e9a397774a0e94efbb8a0bf4a952c28d808cab (diff) |
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 <ian@iarmst.demon.co.uk>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index b7457fc60ba5..1c404e454a36 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c | |||
@@ -600,13 +600,14 @@ retry: | |||
600 | since we may get here before the stream has been fully set-up */ | 600 | since we may get here before the stream has been fully set-up */ |
601 | if (mode == OUT_YUV && s->q_full.length == 0 && itv->dma_data_req_size) { | 601 | if (mode == OUT_YUV && s->q_full.length == 0 && itv->dma_data_req_size) { |
602 | while (count >= itv->dma_data_req_size) { | 602 | while (count >= itv->dma_data_req_size) { |
603 | if (!ivtv_yuv_udma_stream_frame (itv, (void __user *)user_buf)) { | 603 | rc = ivtv_yuv_udma_stream_frame(itv, (void __user *)user_buf); |
604 | bytes_written += itv->dma_data_req_size; | 604 | |
605 | user_buf += itv->dma_data_req_size; | 605 | if (rc < 0) |
606 | count -= itv->dma_data_req_size; | 606 | return rc; |
607 | } else { | 607 | |
608 | break; | 608 | bytes_written += itv->dma_data_req_size; |
609 | } | 609 | user_buf += itv->dma_data_req_size; |
610 | count -= itv->dma_data_req_size; | ||
610 | } | 611 | } |
611 | if (count == 0) { | 612 | if (count == 0) { |
612 | IVTV_DEBUG_HI_FILE("Wrote %d bytes to %s (%d)\n", bytes_written, s->name, s->q_full.bytesused); | 613 | IVTV_DEBUG_HI_FILE("Wrote %d bytes to %s (%d)\n", bytes_written, s->name, s->q_full.bytesused); |