diff options
Diffstat (limited to 'drivers/sbus/char/envctrl.c')
-rw-r--r-- | drivers/sbus/char/envctrl.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c index b0cc3c2588fd..19e8eddf887a 100644 --- a/drivers/sbus/char/envctrl.c +++ b/drivers/sbus/char/envctrl.c | |||
@@ -654,9 +654,8 @@ envctrl_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
654 | /* Function Description: Command what to read. Mapped to user ioctl(). | 654 | /* Function Description: Command what to read. Mapped to user ioctl(). |
655 | * Return: Gives 0 for implemented commands, -EINVAL otherwise. | 655 | * Return: Gives 0 for implemented commands, -EINVAL otherwise. |
656 | */ | 656 | */ |
657 | static int | 657 | static long |
658 | envctrl_ioctl(struct inode *inode, struct file *file, | 658 | envctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg) |
659 | unsigned int cmd, unsigned long arg) | ||
660 | { | 659 | { |
661 | char __user *infobuf; | 660 | char __user *infobuf; |
662 | 661 | ||
@@ -715,11 +714,14 @@ envctrl_release(struct inode *inode, struct file *file) | |||
715 | } | 714 | } |
716 | 715 | ||
717 | static struct file_operations envctrl_fops = { | 716 | static struct file_operations envctrl_fops = { |
718 | .owner = THIS_MODULE, | 717 | .owner = THIS_MODULE, |
719 | .read = envctrl_read, | 718 | .read = envctrl_read, |
720 | .ioctl = envctrl_ioctl, | 719 | .unlocked_ioctl = envctrl_ioctl, |
721 | .open = envctrl_open, | 720 | #ifdef CONFIG_COMPAT |
722 | .release = envctrl_release, | 721 | .compat_ioctl = envctrl_ioctl, |
722 | #endif | ||
723 | .open = envctrl_open, | ||
724 | .release = envctrl_release, | ||
723 | }; | 725 | }; |
724 | 726 | ||
725 | static struct miscdevice envctrl_dev = { | 727 | static struct miscdevice envctrl_dev = { |
@@ -1125,10 +1127,9 @@ out_deregister: | |||
1125 | misc_deregister(&envctrl_dev); | 1127 | misc_deregister(&envctrl_dev); |
1126 | out_iounmap: | 1128 | out_iounmap: |
1127 | iounmap(i2c); | 1129 | iounmap(i2c); |
1128 | for (i = 0; i < ENVCTRL_MAX_CPU * 2; i++) { | 1130 | for (i = 0; i < ENVCTRL_MAX_CPU * 2; i++) |
1129 | if (i2c_childlist[i].tables) | 1131 | kfree(i2c_childlist[i].tables); |
1130 | kfree(i2c_childlist[i].tables); | 1132 | |
1131 | } | ||
1132 | return err; | 1133 | return err; |
1133 | } | 1134 | } |
1134 | 1135 | ||
@@ -1141,10 +1142,8 @@ static void __exit envctrl_cleanup(void) | |||
1141 | iounmap(i2c); | 1142 | iounmap(i2c); |
1142 | misc_deregister(&envctrl_dev); | 1143 | misc_deregister(&envctrl_dev); |
1143 | 1144 | ||
1144 | for (i = 0; i < ENVCTRL_MAX_CPU * 2; i++) { | 1145 | for (i = 0; i < ENVCTRL_MAX_CPU * 2; i++) |
1145 | if (i2c_childlist[i].tables) | 1146 | kfree(i2c_childlist[i].tables); |
1146 | kfree(i2c_childlist[i].tables); | ||
1147 | } | ||
1148 | } | 1147 | } |
1149 | 1148 | ||
1150 | module_init(envctrl_init); | 1149 | module_init(envctrl_init); |