lkml.org 
[lkml]   [2008]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch -v3 09/22] ttusb: use simple_read_from_buffer()
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: v4l-dvb-maintainer@linuxtv.org
---
drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | 18 +++---------------
1 file changed, 3 insertions(+), 15 deletions(-)

Index: 2.6-git/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
===================================================================
--- 2.6-git.orig/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ 2.6-git/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -19,6 +19,7 @@
#include <linux/errno.h>
#include <linux/jiffies.h>
#include <linux/mutex.h>
+#include <linux/fs.h>

#include "dvb_frontend.h"
#include "dmxdev.h"
@@ -983,22 +984,9 @@ static int stc_open(struct inode *inode,
}

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)
--


\
 
 \ /
  Last update: 2008-06-04 14:15    [W:0.107 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site