#ifndef __CRAP_H #define __CRAP_H /** * compatibility crap for old kernels. No guarantee for a working driver * even when everything compiles. */ #include #include #include #ifndef MODULE_LICENSE #define MODULE_LICENSE(x) #endif #ifndef list_for_each_safe #define list_for_each_safe(pos, n, head) \ for (pos = (head)->next, n = pos->next; pos != (head); \ pos = n, n = pos->next) #endif #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45)) || !CONFIG_VIDEO_DEV #define video_usercopy generic_usercopy extern 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)); #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,45) #define video_devdata(dev) (dev->priv) static inline void cond_resched (void) { if (current->need_resched) schedule(); } extern struct page * vmalloc_to_page(void *addr); #define remap_page_range(vma,from,to,size,prot) \ remap_page_range(from,to,size,prot) #endif #endif