Skip to content

Commit f15c3de

Browse files
andy-shevojeda
authored andcommitted
auxdisplay: lcd2s: use module_i2c_driver to simplify the code
Use the module_i2c_driver() macro to make the code smaller and a bit simpler. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 44bb3f0 commit f15c3de

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

drivers/auxdisplay/lcd2s.c

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -371,24 +371,7 @@ static struct i2c_driver lcd2s_i2c_driver = {
371371
.remove = lcd2s_i2c_remove,
372372
.id_table = lcd2s_i2c_id,
373373
};
374-
375-
static int __init lcd2s_modinit(void)
376-
{
377-
int ret = 0;
378-
379-
ret = i2c_add_driver(&lcd2s_i2c_driver);
380-
if (ret != 0)
381-
pr_err("Failed to register lcd2s driver\n");
382-
383-
return ret;
384-
}
385-
module_init(lcd2s_modinit)
386-
387-
static void __exit lcd2s_exit(void)
388-
{
389-
i2c_del_driver(&lcd2s_i2c_driver);
390-
}
391-
module_exit(lcd2s_exit)
374+
module_i2c_driver(lcd2s_i2c_driver);
392375

393376
MODULE_DESCRIPTION("LCD2S character display driver");
394377
MODULE_AUTHOR("Lars Poeschel");

0 commit comments

Comments
 (0)