diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-04-24 11:09:17 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-04-24 11:09:17 -0300 |
commit | 00ae040d86fe4250f09667bacd62bad2bd970090 (patch) | |
tree | 21060857bd52216afd6be2cd668cf2ef3e3b529b /linux/drivers/media/video/sn9c102 | |
parent | 6f290f63b3a7cd010a4bedcd36932b18617b34bb (diff) | |
download | mediapointer-dvb-s2-00ae040d86fe4250f09667bacd62bad2bd970090.tar.gz mediapointer-dvb-s2-00ae040d86fe4250f09667bacd62bad2bd970090.tar.bz2 |
Fix compilation for sn9c102 on older kernels
From: reinhard schwab <reinhard.schwab@aon.at>
Signed-off-by: Reinhard Schwab <reinhard.schwab@aon.at>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/sn9c102')
-rw-r--r-- | linux/drivers/media/video/sn9c102/sn9c102.h | 6 | ||||
-rw-r--r-- | linux/drivers/media/video/sn9c102/sn9c102_core.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/linux/drivers/media/video/sn9c102/sn9c102.h b/linux/drivers/media/video/sn9c102/sn9c102.h index 3f644c63f..1fcb7e73d 100644 --- a/linux/drivers/media/video/sn9c102/sn9c102.h +++ b/linux/drivers/media/video/sn9c102/sn9c102.h @@ -34,7 +34,9 @@ #include <linux/types.h> #include <linux/param.h> #include <linux/rwsem.h> +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) #include <linux/mutex.h> +#endif #include <linux/string.h> #include <linux/stddef.h> @@ -146,7 +148,11 @@ struct sn9c102_device { enum sn9c102_dev_state state; u8 users; +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) struct mutex dev_mutex, fileop_mutex; +#else + struct semaphore dev_mutex, fileop_mutex; +#endif spinlock_t queue_lock; wait_queue_head_t open, wait_frame, wait_stream; }; diff --git a/linux/drivers/media/video/sn9c102/sn9c102_core.c b/linux/drivers/media/video/sn9c102/sn9c102_core.c index ea4394dc9..3add1c79f 100644 --- a/linux/drivers/media/video/sn9c102/sn9c102_core.c +++ b/linux/drivers/media/video/sn9c102/sn9c102_core.c @@ -1769,7 +1769,13 @@ static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma) pos = cam->frame[i].bufmem; while (size > 0) { /* size is page-aligned */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15) + unsigned long page = vmalloc_to_pfn(pos); + if (remap_pfn_range(vma, start, page, PAGE_SIZE, + vma->vm_page_prot)) { +#else if (vm_insert_page(vma, start, vmalloc_to_page(pos))) { +#endif mutex_unlock(&cam->fileop_mutex); return -EAGAIN; } |