--- at91_adc_driver/at91_adc.c 2010-05-18 02:19:13.000000000 -0400 +++ at91_adc_driver/at91_adc.c2638 2011-06-28 12:45:53.573646308 -0400 @@ -31,9 +31,13 @@ #include #include #include +#include #include "at91_adc.h" +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,37) +#define USE_UNLOCKED_IOCTL +#endif static void at91_adc_device_release(struct device *dev){} struct platform_device at91_adc_device = { @@ -115,9 +119,16 @@ ////////////////////////////////////////////////////// // IOCTL interface ////////////////////////////////////////////////////// -static int at91_adc_ioctl( - struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg -){ + +#ifdef USE_UNLOCKED_IOCTL +static long +at91_adc_ioctl(struct file * file, unsigned int cmd, unsigned long arg) +#else +static int +at91_adc_ioctl(struct inode * inode, struct file * file, unsigned int cmd, + unsigned long arg) +#endif +{ int retval = 0; switch (cmd) { case ADC_READ: @@ -128,9 +139,14 @@ } return retval; } + struct file_operations at91_adc_fops = { .owner = THIS_MODULE, +#ifdef USE_UNLOCKED_IOCTL + .unlocked_ioctl = at91_adc_ioctl, +#else .ioctl = at91_adc_ioctl, +#endif }; static void at91_adc_cdev_teardown(void){