[PATCH] Input: tca8418_keypad - switch to using module_i2c_driver()

From: Dmitry Torokhov
Date: Mon Jun 30 2025 - 02:03:52 EST


With kernel supporting deferred probing there is no longer need to play
games with different initcall levels trying to influence probe order.

Switch the driver to use standard module_i2c_driver() to register the
driver.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/input/keyboard/tca8418_keypad.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
index 76fc19ffe21d..68c0afafee7b 100644
--- a/drivers/input/keyboard/tca8418_keypad.c
+++ b/drivers/input/keyboard/tca8418_keypad.c
@@ -373,18 +373,7 @@ static struct i2c_driver tca8418_keypad_driver = {
.probe = tca8418_keypad_probe,
.id_table = tca8418_id,
};
-
-static int __init tca8418_keypad_init(void)
-{
- return i2c_add_driver(&tca8418_keypad_driver);
-}
-subsys_initcall(tca8418_keypad_init);
-
-static void __exit tca8418_keypad_exit(void)
-{
- i2c_del_driver(&tca8418_keypad_driver);
-}
-module_exit(tca8418_keypad_exit);
+module_i2c_driver(tca8418_keypad_driver);

MODULE_AUTHOR("Kyle Manna <kyle.manna@xxxxxxxxx>");
MODULE_DESCRIPTION("Keypad driver for TCA8418");
--
2.50.0.727.gbf7dc18ff4-goog


--
Dmitry