regulator: lp3971: Convert to module_i2c_driver()
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Tue, 3 Apr 2012 22:33:10 +0000 (23:33 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 4 Apr 2012 10:39:17 +0000 (11:39 +0100)
Unusual to see a regulator driver not using subsys_initcall() but with
the probe deferral support should be becoming more and more viable.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
drivers/regulator/lp3971.c

index 49bcdb034895e3757fe44f8d85f3f209e8267277..2013525f4bf9b08874c11615198c6929ed960634 100644 (file)
@@ -517,23 +517,7 @@ static struct i2c_driver lp3971_i2c_driver = {
        .id_table = lp3971_i2c_id,
 };
 
-static int __init lp3971_module_init(void)
-{
-       int ret;
-
-       ret = i2c_add_driver(&lp3971_i2c_driver);
-       if (ret != 0)
-               pr_err("Failed to register I2C driver: %d\n", ret);
-
-       return ret;
-}
-module_init(lp3971_module_init);
-
-static void __exit lp3971_module_exit(void)
-{
-       i2c_del_driver(&lp3971_i2c_driver);
-}
-module_exit(lp3971_module_exit);
+module_i2c_driver(lp3971_i2c_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Marek Szyprowski <m.szyprowski@samsung.com>");