aboutsummaryrefslogtreecommitdiff
path: root/drivers/sbus/char/envctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sbus/char/envctrl.c')
-rw-r--r--drivers/sbus/char/envctrl.c43
1 files changed, 17 insertions, 26 deletions
diff --git a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
index aa2b60a868b..af15a2fdab5 100644
--- a/drivers/sbus/char/envctrl.c
+++ b/drivers/sbus/char/envctrl.c
@@ -19,14 +19,13 @@
*/
#include <linux/module.h>
-#include <linux/init.h>
#include <linux/kthread.h>
#include <linux/delay.h>
#include <linux/ioport.h>
#include <linux/miscdevice.h>
#include <linux/kmod.h>
#include <linux/reboot.h>
-#include <linux/smp_lock.h>
+#include <linux/slab.h>
#include <linux/of.h>
#include <linux/of_device.h>
@@ -353,7 +352,7 @@ static int envctrl_i2c_data_translate(unsigned char data, int translate_type,
default:
break;
- };
+ }
return len;
}
@@ -644,7 +643,7 @@ envctrl_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
default:
break;
- };
+ }
return ret;
}
@@ -687,7 +686,7 @@ envctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
default:
return -EINVAL;
- };
+ }
return 0;
}
@@ -698,7 +697,6 @@ envctrl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
static int
envctrl_open(struct inode *inode, struct file *file)
{
- cycle_kernel_lock();
file->private_data = NULL;
return 0;
}
@@ -721,6 +719,7 @@ static const struct file_operations envctrl_fops = {
#endif
.open = envctrl_open,
.release = envctrl_release,
+ .llseek = noop_llseek,
};
static struct miscdevice envctrl_dev = {
@@ -947,7 +946,7 @@ static void envctrl_init_i2c_child(struct device_node *dp,
default:
break;
- };
+ }
}
}
@@ -1028,8 +1027,7 @@ static int kenvctrld(void *__unused)
return 0;
}
-static int __devinit envctrl_probe(struct of_device *op,
- const struct of_device_id *match)
+static int envctrl_probe(struct platform_device *op)
{
struct device_node *dp;
int index, err;
@@ -1042,7 +1040,7 @@ static int __devinit envctrl_probe(struct of_device *op,
return -ENOMEM;
index = 0;
- dp = op->node->child;
+ dp = op->dev.of_node->child;
while (dp) {
if (!strcmp(dp->name, "gpio")) {
i2c_childlist[index].i2ctype = I2C_GPIO;
@@ -1105,7 +1103,7 @@ out_iounmap:
return err;
}
-static int __devexit envctrl_remove(struct of_device *op)
+static int envctrl_remove(struct platform_device *op)
{
int index;
@@ -1129,23 +1127,16 @@ static const struct of_device_id envctrl_match[] = {
};
MODULE_DEVICE_TABLE(of, envctrl_match);
-static struct of_platform_driver envctrl_driver = {
- .name = DRIVER_NAME,
- .match_table = envctrl_match,
+static struct platform_driver envctrl_driver = {
+ .driver = {
+ .name = DRIVER_NAME,
+ .owner = THIS_MODULE,
+ .of_match_table = envctrl_match,
+ },
.probe = envctrl_probe,
- .remove = __devexit_p(envctrl_remove),
+ .remove = envctrl_remove,
};
-static int __init envctrl_init(void)
-{
- return of_register_driver(&envctrl_driver, &of_bus_type);
-}
-
-static void __exit envctrl_exit(void)
-{
- of_unregister_driver(&envctrl_driver);
-}
+module_platform_driver(envctrl_driver);
-module_init(envctrl_init);
-module_exit(envctrl_exit);
MODULE_LICENSE("GPL");