[PATCH v3 04/10] mt9m032: Use module_i2c_driver() macro

Laurent Pinchart
2012-03-03T15:28:02Z

Replace the custom driver init and exit functions by
module_i2c_driver().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/media/video/mt9m032.c | 19 +------------------
1 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/drivers/media/video/mt9m032.c b/drivers/media/video/mt9m032.c
index e09f9a5..a821b91 100644
--- a/drivers/media/video/mt9m032.c
+++ b/drivers/media/video/mt9m032.c
@@ -806,24 +806,7 @@ static struct i2c_driver mt9m032_i2c_driver = {
.id_table = mt9m032_id_table,
};

-static int __init mt9m032_init(void)
-{
- int rval;
-
- rval = i2c_add_driver(&mt9m032_i2c_driver);
- if (rval)
- pr_err("%s: failed registering " MT9M032_NAME "\n", __func__);
-
- return rval;
-}
-
-static void mt9m032_exit(void)
-{
- i2c_del_driver(&mt9m032_i2c_driver);
-}
-
-module_init(mt9m032_init);
-module_exit(mt9m032_exit);
+module_i2c_driver(mt9m032_i2c_driver);

MODULE_AUTHOR("Martin Hostettler <martin@neutronstar.dyndns.org>");
MODULE_DESCRIPTION("MT9M032 camera sensor driver");
--
1.7.3.4