aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttusb-budget
diff options
context:
space:
mode:
authorAkinobu Mita <akinobu.mita@gmail.com>2008-07-04 05:33:20 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:19:04 -0400
commita8a89b7f60f18c2517c3b950f5ecede0626363eb (patch)
treeb1c1019e5606b92e2f70439b71cedde7b6d29b47 /drivers/media/dvb/ttusb-budget
parent3fce3fb0592841857ae01334d0c6934c1ad32faf (diff)
V4L/DVB (8251): ttusb: use simple_read_from_buffer()()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/ttusb-budget')
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 156072239374..e6c9cd2e3b94 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <linux/fs.h>
15#include <linux/module.h> 16#include <linux/module.h>
16#include <linux/usb.h> 17#include <linux/usb.h>
17#include <linux/delay.h> 18#include <linux/delay.h>
@@ -990,22 +991,9 @@ static int stc_open(struct inode *inode, struct file *file)
990} 991}
991 992
992static ssize_t stc_read(struct file *file, char *buf, size_t count, 993static ssize_t stc_read(struct file *file, char *buf, size_t count,
993 loff_t * offset) 994 loff_t *offset)
994{ 995{
995 int tc = count; 996 return simple_read_from_buffer(buf, count, offset, stc_firmware, 8192);
996
997 if ((tc + *offset) > 8192)
998 tc = 8192 - *offset;
999
1000 if (tc < 0)
1001 return 0;
1002
1003 if (copy_to_user(buf, stc_firmware + *offset, tc))
1004 return -EFAULT;
1005
1006 *offset += tc;
1007
1008 return tc;
1009} 997}
1010 998
1011static int stc_release(struct inode *inode, struct file *file) 999static int stc_release(struct inode *inode, struct file *file)