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>
This commit is contained in:
Andy Shevchenko 2022-03-08 17:11:17 +02:00 committed by Miguel Ojeda
parent 44bb3f038e
commit f15c3dea5e

View File

@ -371,24 +371,7 @@ static struct i2c_driver lcd2s_i2c_driver = {
.remove = lcd2s_i2c_remove, .remove = lcd2s_i2c_remove,
.id_table = lcd2s_i2c_id, .id_table = lcd2s_i2c_id,
}; };
module_i2c_driver(lcd2s_i2c_driver);
static int __init lcd2s_modinit(void)
{
int ret = 0;
ret = i2c_add_driver(&lcd2s_i2c_driver);
if (ret != 0)
pr_err("Failed to register lcd2s driver\n");
return ret;
}
module_init(lcd2s_modinit)
static void __exit lcd2s_exit(void)
{
i2c_del_driver(&lcd2s_i2c_driver);
}
module_exit(lcd2s_exit)
MODULE_DESCRIPTION("LCD2S character display driver"); MODULE_DESCRIPTION("LCD2S character display driver");
MODULE_AUTHOR("Lars Poeschel"); MODULE_AUTHOR("Lars Poeschel");