]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mfd: stmpe-i2c: Use module_i2c_driver to remove boilerplate
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Fri, 25 Jul 2025 07:07:50 +0000 (09:07 +0200)
committerLee Jones <lee@kernel.org>
Wed, 1 Oct 2025 09:28:06 +0000 (10:28 +0100)
Driver implements feature of module_i2c_driver() manually. Replace it by
that macro instead.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20250725070752.338376-3-alexander.stein@ew.tq-group.com
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/stmpe-i2c.c

index fe018bedab9837dd5a7c9848d244cf1caba0014c..145836320c1707e93eaea253f70c437a087b7fbb 100644 (file)
@@ -122,18 +122,7 @@ static struct i2c_driver stmpe_i2c_driver = {
        .remove         = stmpe_i2c_remove,
        .id_table       = stmpe_i2c_id,
 };
-
-static int __init stmpe_init(void)
-{
-       return i2c_add_driver(&stmpe_i2c_driver);
-}
-subsys_initcall(stmpe_init);
-
-static void __exit stmpe_exit(void)
-{
-       i2c_del_driver(&stmpe_i2c_driver);
-}
-module_exit(stmpe_exit);
+module_i2c_driver(stmpe_i2c_driver);
 
 MODULE_DESCRIPTION("STMPE MFD I2C Interface Driver");
 MODULE_AUTHOR("Rabin Vincent <rabin.vincent@stericsson.com>");