From: Harshal Chaudhari <harshalchau04@gmail.com>
To: wim@linux-watchdog.org, linux@roeck-us.net
Cc: linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] watchdog: gef_wdt.c: convert to module_platform_driver()
Date: Mon, 18 May 2020 17:19:54 +0530 [thread overview]
Message-ID: <20200518114954.7417-1-harshalchau04@gmail.com> (raw)
The driver init and exit function don't do anything besides registering
and unregistering the platform driver, so the module_platform_driver()
macro could just be used instead of having separate functions.
Signed-off-by: Harshal Chaudhari <harshalchau04@gmail.com>
---
drivers/watchdog/gef_wdt.c | 14 +-------------
1 file changed, 1 insertion(+), 13 deletions(-)
diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c
index f6541d1b65e3..4421a452d0f5 100644
--- a/drivers/watchdog/gef_wdt.c
+++ b/drivers/watchdog/gef_wdt.c
@@ -311,19 +311,7 @@ static struct platform_driver gef_wdt_driver = {
.remove = gef_wdt_remove,
};
-static int __init gef_wdt_init(void)
-{
- pr_info("GE watchdog driver\n");
- return platform_driver_register(&gef_wdt_driver);
-}
-
-static void __exit gef_wdt_exit(void)
-{
- platform_driver_unregister(&gef_wdt_driver);
-}
-
-module_init(gef_wdt_init);
-module_exit(gef_wdt_exit);
+module_platform_driver(gef_wdt_driver);
MODULE_AUTHOR("Martyn Welch <martyn.welch@ge.com>");
MODULE_DESCRIPTION("GE watchdog driver");
--
2.17.1
reply other threads:[~2020-05-18 11:50 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20200518114954.7417-1-harshalchau04@gmail.com \
--to=harshalchau04@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=wim@linux-watchdog.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).