Commit fddc87bb authored by John Tyner's avatar John Tyner Committed by Greg Kroah-Hartman

[PATCH] drivers/usb/media/vicam.c: simplify vicam_read

> The following patch removes the old framebuf_size and framebuf_read_start
> values from the cam structure and simplifes the read function. It also
> moves the needs dummy read check into the read_frame function. cp and dd
> should both still work.

This is in addition to the previous patch. It should allow any programs
that read entire frames to receive a new frame with each successive read.
Programs that read less than the entire frame will read until they reach
the end of the frame. They will then read 0 bytes (signifying EOF). The
next read will start the next frame.
parent 001e41c0
......@@ -1004,6 +1004,10 @@ vicam_read( struct file *file, char *buf, size_t count, loff_t *ppos )
*ppos += count;
}
if (count == VICAM_MAX_FRAME_SIZE) {
*ppos = 0;
}
up(&cam->busy_lock);
return count;
......
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