diff options
author | Michael Hunold <devnull@localhost> | 2002-12-17 15:05:45 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2002-12-17 15:05:45 +0000 |
commit | 323dee0dd2b07f636e703605664b2f92d93c403b (patch) | |
tree | d10e80338456cfaf8f4c5d56dfee5abd37190c13 /linux/drivers/media/dvb/dvb-core/compat.c | |
parent | 54edc80d17bdac1b10665581c645ba6bac3f54f9 (diff) | |
download | mediapointer-dvb-s2-323dee0dd2b07f636e703605664b2f92d93c403b.tar.gz mediapointer-dvb-s2-323dee0dd2b07f636e703605664b2f92d93c403b.tar.bz2 |
Remove most of the compatiblilty crap from "compat.h", the new
saa7146 does not need the stuff any more. Propagate these changes
to some of the files.
Remove unnecessary stuff from the Makefile,
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/compat.c')
-rw-r--r-- | linux/drivers/media/dvb/dvb-core/compat.c | 86 |
1 files changed, 0 insertions, 86 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/compat.c b/linux/drivers/media/dvb/dvb-core/compat.c index 4c658f33d..925fbdefb 100644 --- a/linux/drivers/media/dvb/dvb-core/compat.c +++ b/linux/drivers/media/dvb/dvb-core/compat.c @@ -8,92 +8,6 @@ * even when everything compiles. */ -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) || !CONFIG_VIDEO_DEV -int generic_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; -} -EXPORT_SYMBOL(generic_usercopy); -#endif - - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) -struct page * vmalloc_to_page(void *vmalloc_addr) -{ - unsigned long addr = (unsigned long) vmalloc_addr; - struct page *page = NULL; - pgd_t *pgd = pgd_offset_k(addr); - pmd_t *pmd; - pte_t *ptep, pte; - - if (!pgd_none(*pgd)) { - pmd = pmd_offset(pgd, addr); - if (!pmd_none(*pmd)) { - ptep = pte_offset(pmd, addr); - pte = *ptep; - if (pte_present(pte)) - page = pte_page(pte); - } - } - return page; -} -EXPORT_SYMBOL(vmalloc_to_page); -#endif - - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) static u32 crc32_table[256] = { |