X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Fstaging%2Flirc%2Flirc_sir.c;h=c553ab6262386ad4b68916f928ee25c770f3fbf2;hp=2478871bd95efbedd72f7e09b7f6cb451ecf0f0b;hb=0851668fdd97e526b2a41f794b785c204dd3d3e0;hpb=5cc103506289de7ee0a0b526ae0381541990cad4 diff --git a/drivers/staging/lirc/lirc_sir.c b/drivers/staging/lirc/lirc_sir.c index 2478871bd95e..c553ab626238 100644 --- a/drivers/staging/lirc/lirc_sir.c +++ b/drivers/staging/lirc/lirc_sir.c @@ -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,