Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8a89b7f authored by Akinobu Mita's avatar Akinobu Mita Committed by Mauro Carvalho Chehab
Browse files

V4L/DVB (8251): ttusb: use simple_read_from_buffer()()

parent 3fce3fb0
Loading
Loading
Loading
Loading
+3 −15
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/wait.h>
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/delay.h>
@@ -992,20 +993,7 @@ static int stc_open(struct inode *inode, struct file *file)
static ssize_t stc_read(struct file *file, char *buf, size_t count,
		 loff_t *offset)
{
	int tc = count;

	if ((tc + *offset) > 8192)
		tc = 8192 - *offset;

	if (tc < 0)
		return 0;

	if (copy_to_user(buf, stc_firmware + *offset, tc))
		return -EFAULT;

	*offset += tc;

	return tc;
	return simple_read_from_buffer(buf, count, offset, stc_firmware, 8192);
}

static int stc_release(struct inode *inode, struct file *file)