diff options
author | Michael Hunold <devnull@localhost> | 2003-01-03 17:16:42 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2003-01-03 17:16:42 +0000 |
commit | bd8c6ee428efa388f2ef1d6c1a42dde0c21bbb51 (patch) | |
tree | 8e1e4d9aa181233db4686576913b87402c64fc84 /linux/drivers/media/dvb/dvb-core/dvbdev.c | |
parent | 76eafd9ffccb43beb97cdcf2e688c98c3e92638d (diff) | |
download | mediapointer-dvb-s2-bd8c6ee428efa388f2ef1d6c1a42dde0c21bbb51.tar.gz mediapointer-dvb-s2-bd8c6ee428efa388f2ef1d6c1a42dde0c21bbb51.tar.bz2 |
Build fixes for 2.5.x, thank Gregoire Favre <greg@ulima.unil.ch>
for pointing out these flaws regularly...
Changes in detail:
- added comapt.[ch] again, but removed the *_usercopy() crap. We
define dvb_usercopy() until generic_usercopy() is available.
If you have an external source tree, please check what's actually
needed to get your application to compile and report back to me
or on the mailing list. Thanks!
(Necessary changes to the Makefile, and various dvb files, removed some
unnecessary #include <linux/videodev>)
- added linux/lib/Makefile. We need to add an include to
drivers/media/dvb/dvb-core/Makefile.lib, so that crc32.o
gets build automagically
(Adjusted the "makelinks" script as well)
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dvbdev.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/dvbdev.c | 64 |
1 files changed, 1 insertions, 63 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index c6b39b66e..e858b3945 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -37,9 +37,9 @@ #include <asm/system.h> #include <linux/kmod.h> #include <linux/slab.h> -#include <linux/videodev.h> #include "dvbdev.h" +#include "compat.h" static int dvbdev_debug = 0; #define dprintk if (dvbdev_debug) printk @@ -67,68 +67,6 @@ static char *dnames[] = { #define nums2minor(num,type,id) ((num << 6) | (id << 4) | type) #define DVB_DEVFS_FLAGS (DEVFS_FL_DEFAULT) -/* this is the same as video_usercopy() and should be replaced as - discussed already with something like generic_usercopy() */ -int dvb_usercopy(struct inode *inode, struct file *file, - unsigned int cmd, unsigned long arg, - int (*func)(struct inode *inode, struct file *file, - unsigned int cmd, void *arg)) -{ - char sbuf[128]; - void *mbuf = NULL; - void *parg = NULL; - int err = -EINVAL; - - /* Copy arguments into temp kernel buffer */ - switch (_IOC_DIR(cmd)) { - case _IOC_NONE: - parg = (void *)arg; - break; - case _IOC_READ: /* some v4l ioctls are marked wrong ... */ - case _IOC_WRITE: - case (_IOC_WRITE | _IOC_READ): - if (_IOC_SIZE(cmd) <= sizeof(sbuf)) { - parg = sbuf; - } else { - /* too big to allocate from stack */ - mbuf = kmalloc(_IOC_SIZE(cmd),GFP_KERNEL); - if (NULL == mbuf) - return -ENOMEM; - parg = mbuf; - } - - err = -EFAULT; - if (copy_from_user(parg, (void *)arg, _IOC_SIZE(cmd))) - goto out; - break; - } - - /* call driver */ - if ((err = func(inode, file, cmd, parg)) == -ENOIOCTLCMD) - err = -EINVAL; - - if (err < 0) - goto out; - - /* Copy results into user buffer */ - switch (_IOC_DIR(cmd)) - { - case _IOC_READ: - case (_IOC_WRITE | _IOC_READ): - if (copy_to_user((void *)arg, parg, _IOC_SIZE(cmd))) - err = -EFAULT; - break; - } - -out: - if (mbuf) - kfree(mbuf); - - return err; -} - - - static struct dvb_device* dvbdev_find_device (int minor) { |