aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/most
diff options
context:
space:
mode:
authorShraddha Barke <shraddha.6596@gmail.com>2015-09-29 11:14:42 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-29 15:20:35 +0200
commit5bd28f0701ca989629bfeae86e5167b54804bb60 (patch)
treed6a90c72d128c7589dbd4101f0cb0085cdfdfe42 /drivers/staging/most
parentstaging: comedi: ni_tiocmd: remove unused code (diff)
downloadlinux-dev-5bd28f0701ca989629bfeae86e5167b54804bb60.tar.xz
linux-dev-5bd28f0701ca989629bfeae86e5167b54804bb60.zip
Staging: most: Use module_i2c_driver
Macro module_i2c_driver is used for drivers whose init and exit paths does only register and unregister to i2c API. Remove some boilerplate code by using module_i2c_driver. Problem found using Coccinelle. Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/most')
-rw-r--r--drivers/staging/most/hdm-i2c/hdm_i2c.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/staging/most/hdm-i2c/hdm_i2c.c b/drivers/staging/most/hdm-i2c/hdm_i2c.c
index 7e0c46154bb8..cffea40d09d0 100644
--- a/drivers/staging/most/hdm-i2c/hdm_i2c.c
+++ b/drivers/staging/most/hdm-i2c/hdm_i2c.c
@@ -423,27 +423,7 @@ static struct i2c_driver i2c_driver = {
.id_table = i2c_id,
};
-/**
- * hdm_i2c_init - Driver Registration Routine
- */
-static int __init hdm_i2c_init(void)
-{
- pr_info("hdm_i2c_init()\n");
-
- return i2c_add_driver(&i2c_driver);
-}
-
-/**
- * hdm_i2c_exit - Driver Cleanup Routine
- **/
-static void __exit hdm_i2c_exit(void)
-{
- i2c_del_driver(&i2c_driver);
- pr_info("hdm_i2c_exit()\n");
-}
-
-module_init(hdm_i2c_init);
-module_exit(hdm_i2c_exit);
+module_i2c_driver(i2c_driver);
MODULE_AUTHOR("Jain Roy Ambi <JainRoy.Ambi@microchip.com>");
MODULE_AUTHOR("Andrey Shvetsov <andrey.shvetsov@k2l.de>");