]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (9190): ivtv: yuv write() error handling tweak
authorIan Armstrong <ian@iarmst.demon.co.uk>
Sat, 11 Oct 2008 09:39:05 +0000 (06:39 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 17 Oct 2008 20:13:58 +0000 (17:13 -0300)
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>
drivers/media/video/ivtv/ivtv-fileops.c

index b7457fc60ba5964c5131cc5282c1b2f29f831411..1c404e454a36f6c601550fd261e2cc65e42805ec 100644 (file)
@@ -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);