diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-06-15 15:39:55 -0400 |
---|---|---|
committer | Michael Krufky <mkrufky@linuxtv.org> | 2008-06-15 15:39:55 -0400 |
commit | 56e6595b318ac3a5b15f9e9c8048a2937ad287be (patch) | |
tree | d3fc2525a4c351f5704b31bac9e5436177accb83 /linux/drivers/media | |
parent | dca6d129e2f6f45454f71a73fdc216c8832052d6 (diff) | |
download | mediapointer-dvb-s2-56e6595b318ac3a5b15f9e9c8048a2937ad287be.tar.gz mediapointer-dvb-s2-56e6595b318ac3a5b15f9e9c8048a2937ad287be.tar.bz2 |
sms1xxx: remove #if LINUX_VERSION_CODE checks
From: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/dvb/siano/smscoreapi.c | 60 | ||||
-rw-r--r-- | linux/drivers/media/dvb/siano/smscoreapi.h | 16 |
2 files changed, 1 insertions, 75 deletions
diff --git a/linux/drivers/media/dvb/siano/smscoreapi.c b/linux/drivers/media/dvb/siano/smscoreapi.c index dda3cf853..0589a4759 100644 --- a/linux/drivers/media/dvb/siano/smscoreapi.c +++ b/linux/drivers/media/dvb/siano/smscoreapi.c @@ -200,55 +200,6 @@ void smscore_registry_settype(char *devpath, enum sms_device_type_st type) } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) -void *kzalloc(size_t size, int flags) -{ - void *ret = kmalloc(size, flags); - if (ret) - memset(ret, 0, size); - return ret; -} - -static inline unsigned long kvirt_to_pa(unsigned long adr) -{ - unsigned long kva, ret; - - kva = (unsigned long) page_address(virt_to_page((void *)adr)); - kva |= adr & (PAGE_SIZE-1); /* restore the offset */ - ret = __pa(kva); - return ret; -} - -unsigned long wait_for_completion_timeout(struct completion *x, - unsigned long timeout) -{ - might_sleep(); - - spin_lock_irq(&x->wait.lock); - if (!x->done) { - DECLARE_WAITQUEUE(wait, current); - - wait.flags |= WQ_FLAG_EXCLUSIVE; - __add_wait_queue_tail(&x->wait, &wait); - do { - __set_current_state(TASK_UNINTERRUPTIBLE); - spin_unlock_irq(&x->wait.lock); - timeout = schedule_timeout(timeout); - spin_lock_irq(&x->wait.lock); - if (!timeout) { - __remove_wait_queue(&x->wait, &wait); - goto out; - } - } while (!x->done); - __remove_wait_queue(&x->wait, &wait); - } - x->done--; -out: - spin_unlock_irq(&x->wait.lock); - return timeout; -} -#endif - void list_add_locked(struct list_head *new, struct list_head *head, spinlock_t *lock) { @@ -640,8 +591,6 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev, loadfirmware_t loadfirmware_handler) { int rc = -ENOENT; - -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10) const struct firmware *fw; u8 *fw_buffer; @@ -677,7 +626,6 @@ int smscore_load_firmware_from_file(struct smscore_device_t *coredev, } release_firmware(fw); -#endif return rc; } @@ -1287,15 +1235,9 @@ int smscore_map_common_buffer(struct smscore_device_t *coredev, return -EINVAL; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) - if (remap_page_range(vma, start, coredev->common_buffer_phys, size, - vma->vm_page_prot)) -#else if (remap_pfn_range(vma, start, coredev->common_buffer_phys >> PAGE_SHIFT, - size, pgprot_noncached(vma->vm_page_prot))) -#endif - { + size, pgprot_noncached(vma->vm_page_prot))) { printk(KERN_INFO "%s remap_page_range failed\n", __func__); return -EAGAIN; } diff --git a/linux/drivers/media/dvb/siano/smscoreapi.h b/linux/drivers/media/dvb/siano/smscoreapi.h index deeb4c2d7..b545ee0c1 100644 --- a/linux/drivers/media/dvb/siano/smscoreapi.h +++ b/linux/drivers/media/dvb/siano/smscoreapi.h @@ -34,7 +34,6 @@ #include "dvb_demux.h" #include "dvb_frontend.h" -#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) #include <linux/mutex.h> typedef struct mutex kmutex_t; @@ -44,21 +43,6 @@ typedef struct mutex kmutex_t; #define kmutex_trylock(_p_) mutex_trylock(_p_) #define kmutex_unlock(_p_) mutex_unlock(_p_) -#else -#include <asm/semaphore.h> - -typedef struct semaphore kmutex_t; - -#define kmutex_init(_p_) init_MUTEX(_p_) -#define kmutex_lock(_p_) down(_p_) -#define kmutex_trylock(_p_) (!down_trylock(_p_)) -#define kmutex_unlock(_p_) up(_p_) - -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10) -void *kzalloc(size_t size, int flags); -#endif -#endif /* LINUX_VERSION */ - #ifndef min #define min(a, b) (((a) < (b)) ? (a) : (b)) #endif |