Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab...
[pandora-kernel.git] / drivers / staging / lirc / lirc_sir.c
index 2478871..c553ab6 100644 (file)
@@ -336,9 +336,8 @@ static ssize_t lirc_write(struct file *file, const char *buf, size_t n,
 static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 {
        int retval = 0;
-       unsigned long value = 0;
+       __u32 value = 0;
 #ifdef LIRC_ON_SA1100
-       unsigned int ivalue;
 
        if (cmd == LIRC_GET_FEATURES)
                value = LIRC_CAN_SEND_PULSE |
@@ -362,22 +361,22 @@ static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
        case LIRC_GET_FEATURES:
        case LIRC_GET_SEND_MODE:
        case LIRC_GET_REC_MODE:
-               retval = put_user(value, (unsigned long *) arg);
+               retval = put_user(value, (__u32 *) arg);
                break;
 
        case LIRC_SET_SEND_MODE:
        case LIRC_SET_REC_MODE:
-               retval = get_user(value, (unsigned long *) arg);
+               retval = get_user(value, (__u32 *) arg);
                break;
 #ifdef LIRC_ON_SA1100
        case LIRC_SET_SEND_DUTY_CYCLE:
-               retval = get_user(ivalue, (unsigned int *) arg);
+               retval = get_user(value, (__u32 *) arg);
                if (retval)
                        return retval;
-               if (ivalue <= 0 || ivalue > 100)
+               if (value <= 0 || value > 100)
                        return -EINVAL;
-               /* (ivalue/100)*(1000000/freq) */
-               duty_cycle = ivalue;
+               /* (value/100)*(1000000/freq) */
+               duty_cycle = value;
                pulse_width = (unsigned long) duty_cycle*10000/freq;
                space_width = (unsigned long) 1000000L/freq-pulse_width;
                if (pulse_width >= LIRC_ON_SA1100_TRANSMITTER_LATENCY)
@@ -386,12 +385,12 @@ static long lirc_ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
                        space_width -= LIRC_ON_SA1100_TRANSMITTER_LATENCY;
                break;
        case LIRC_SET_SEND_CARRIER:
-               retval = get_user(ivalue, (unsigned int *) arg);
+               retval = get_user(value, (__u32 *) arg);
                if (retval)
                        return retval;
-               if (ivalue > 500000 || ivalue < 20000)
+               if (value > 500000 || value < 20000)
                        return -EINVAL;
-               freq = ivalue;
+               freq = value;
                pulse_width = (unsigned long) duty_cycle*10000/freq;
                space_width = (unsigned long) 1000000L/freq-pulse_width;
                if (pulse_width >= LIRC_ON_SA1100_TRANSMITTER_LATENCY)
@@ -457,6 +456,9 @@ static const struct file_operations lirc_fops = {
        .write          = lirc_write,
        .poll           = lirc_poll,
        .unlocked_ioctl = lirc_ioctl,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl   = lirc_ioctl,
+#endif
        .open           = lirc_dev_fop_open,
        .release        = lirc_dev_fop_close,
        .llseek         = no_llseek,