]> git.baikalelectronics.ru Git - kernel.git/commitdiff
regulator: pca9450: Convert to use module_i2c_driver
authorAxel Lin <axel.lin@ingics.com>
Sat, 25 Jul 2020 01:44:14 +0000 (09:44 +0800)
committerMark Brown <broonie@kernel.org>
Mon, 27 Jul 2020 13:34:22 +0000 (14:34 +0100)
Use module_i2c_driver to simplify driver init boilerplate.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20200725014414.1825183-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/pca9450-regulator.c

index 02250459aa9039dd692a1bd5493c4be9a36724a8..eb5822bf53e013714442ce654d5804d8248601dc 100644 (file)
@@ -826,17 +826,7 @@ static struct i2c_driver pca9450_i2c_driver = {
        .probe = pca9450_i2c_probe,
 };
 
-static int __init pca9450_i2c_init(void)
-{
-       return i2c_add_driver(&pca9450_i2c_driver);
-}
-module_init(pca9450_i2c_init);
-
-static void __exit pca9450_i2c_exit(void)
-{
-       i2c_del_driver(&pca9450_i2c_driver);
-}
-module_exit(pca9450_i2c_exit);
+module_i2c_driver(pca9450_i2c_driver);
 
 MODULE_AUTHOR("Robin Gong <yibin.gong@nxp.com>");
 MODULE_DESCRIPTION("NXP PCA9450 Power Management IC driver");