From: Koen Kooi Subject: omap3-sgx-modules: make it build with recent kernels This patch fixes 2 problems: 1) use of omap_rev_*_*() to get ES revision, the patch adding that to the kernel was rejected 2) removal of .ioctl from struct file_operations for BKL restructuring Signed-off-by: Koen Kooi --- /tmp/bc_cat.c 2010-12-04 16:18:19.000000000 +0100 +++ GFX_Linux_KM/services4/3rdparty/bufferclass_ti/bc_cat.c 2010-12-04 16:21:34.000000000 +0100 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -79,7 +80,7 @@ static int bc_open(struct inode *i, struct file *f); static int bc_release(struct inode *i, struct file *f); -static int bc_ioctl(struct inode *inode, struct file *file, +static int bc_ioctl(struct file *file, unsigned int cmd, unsigned long arg); static int bc_mmap(struct file *filp, struct vm_area_struct *vma); @@ -121,8 +122,15 @@ static struct file_operations bc_cat_fops = { .open = bc_open, .release = bc_release, - .ioctl = bc_ioctl, - .mmap = bc_mmap, +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) + .ioctl = bc_ioctl, +#else + .unlocked_ioctl = bc_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = bc_ioctl, +#endif +#endif + .mmap = bc_mmap, }; @@ -492,7 +500,7 @@ #ifdef PLAT_TI8168 width_align = 8; #else - width_align = cpu_is_omap3530() && omap_rev_lt_3_0() ? 32 : 8; + width_align = cpu_is_omap3530() && ( omap_rev() < OMAP3430_REV_ES3_0 ) ? 32 : 8; #endif major = register_chrdev(0, DEVNAME, &bc_cat_fops); @@ -690,7 +698,7 @@ return 0; } -static int bc_ioctl(struct inode *inode, struct file *file, +static int bc_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { BC_CAT_DEVINFO *devinfo;