summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttusb-budget
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-07-04 06:33:20 +0000
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-04 06:33:20 +0000
commitf03368d89250498c6d9f48b12972121c891e5fe2 (patch)
treeef2a95a574902e7c2236cfd50bb9062d0ed9f65f /linux/drivers/media/dvb/ttusb-budget
parent754f080bdf7412769906262dfad451a6f90f2077 (diff)
downloadmediapointer-dvb-s2-f03368d89250498c6d9f48b12972121c891e5fe2.tar.gz
mediapointer-dvb-s2-f03368d89250498c6d9f48b12972121c891e5fe2.tar.bz2
ttusb: use simple_read_from_buffer()()
From: Akinobu Mita <akinobu.mita@gmail.com> 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 'linux/drivers/media/dvb/ttusb-budget')
-rw-r--r--linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 8786d3d6f..133648277 100644
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -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>
@@ -988,22 +989,9 @@ 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)
+ 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)