aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c')
-rw-r--r--drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c22
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index bc2043e44ebd..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)
@@ -1693,11 +1681,7 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i
1693 1681
1694 i2c_set_adapdata(&ttusb->i2c_adap, ttusb); 1682 i2c_set_adapdata(&ttusb->i2c_adap, ttusb);
1695 1683
1696#ifdef I2C_ADAP_CLASS_TV_DIGITAL
1697 ttusb->i2c_adap.class = I2C_ADAP_CLASS_TV_DIGITAL;
1698#else
1699 ttusb->i2c_adap.class = I2C_CLASS_TV_DIGITAL; 1684 ttusb->i2c_adap.class = I2C_CLASS_TV_DIGITAL;
1700#endif
1701 ttusb->i2c_adap.algo = &ttusb_dec_algo; 1685 ttusb->i2c_adap.algo = &ttusb_dec_algo;
1702 ttusb->i2c_adap.algo_data = NULL; 1686 ttusb->i2c_adap.algo_data = NULL;
1703 ttusb->i2c_adap.dev.parent = &udev->dev; 1687 ttusb->i2c_adap.dev.parent = &udev->dev;