From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Miguel Ojeda <ojeda@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH v1 2/4] auxdisplay: lcd2s: use module_i2c_driver to simplify the code
Date: Tue, 8 Mar 2022 17:11:17 +0200 [thread overview]
Message-ID: <20220308151119.48412-2-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220308151119.48412-1-andriy.shevchenko@linux.intel.com>
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>
---
drivers/auxdisplay/lcd2s.c | 19 +------------------
1 file changed, 1 insertion(+), 18 deletions(-)
diff --git a/drivers/auxdisplay/lcd2s.c b/drivers/auxdisplay/lcd2s.c
index c75e9d66aaa1..5201a621de45 100644
--- a/drivers/auxdisplay/lcd2s.c
+++ b/drivers/auxdisplay/lcd2s.c
@@ -372,24 +372,7 @@ static struct i2c_driver lcd2s_i2c_driver = {
.remove = lcd2s_i2c_remove,
.id_table = lcd2s_i2c_id,
};
-
-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_i2c_driver(lcd2s_i2c_driver);
MODULE_DESCRIPTION("LCD2S character display driver");
MODULE_AUTHOR("Lars Poeschel");
--
2.34.1
next prev parent reply other threads:[~2022-03-08 15:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-08 15:11 [PATCH v1 1/4] auxdisplay: lcd2s: make use of device property API Andy Shevchenko
2022-03-08 15:11 ` Andy Shevchenko [this message]
2022-03-08 15:11 ` [PATCH v1 3/4] auxdisplay: lcd2s: Switch to i2c ->probe_new() Andy Shevchenko
2022-03-08 15:11 ` [PATCH v1 4/4] auxdisplay: lcd2s: Use array size explicitly in lcd2s_gotoxy() Andy Shevchenko
2022-03-19 0:29 ` Miguel Ojeda
2022-03-19 11:37 ` Andy Shevchenko
2022-03-23 19:15 ` Miguel Ojeda
2022-03-24 9:21 ` Andy Shevchenko
2022-03-23 19:02 ` [PATCH v1 1/4] auxdisplay: lcd2s: make use of device property API Miguel Ojeda
2022-03-24 9:21 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220308151119.48412-2-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).