From: JJ Ding <jj_ding@emc.com.tw>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Greg Kroah-Hartman <gregkh@suse.de>,
Grant Likely <grant.likely@secretlab.ca>
Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
JJ Ding <jj_ding@emc.com.tw>, JJ Ding <dgdunix@gmail.com>
Subject: [PATCH TRIVIAL 4/5] Input: serio: use macro module_platform_driver()
Date: Tue, 22 Nov 2011 17:00:45 +0800 [thread overview]
Message-ID: <1321952446-7591-5-git-send-email-jj_ding@emc.com.tw> (raw)
In-Reply-To: <1321952446-7591-1-git-send-email-jj_ding@emc.com.tw>
From: JJ Ding <dgdunix@gmail.com>
Commit 940ab88962bc1aff3273a8356d64577a6e386736 introduced a new macro to
save some platform_driver boilerplate code. Use it.
Signed-off-by: JJ Ding <dgdunix@gmail.com>
---
drivers/input/serio/altera_ps2.c | 13 +------------
drivers/input/serio/at32psif.c | 14 +-------------
drivers/input/serio/rpckbd.c | 14 +-------------
drivers/input/serio/xilinx_ps2.c | 14 +-------------
4 files changed, 4 insertions(+), 51 deletions(-)
diff --git a/drivers/input/serio/altera_ps2.c b/drivers/input/serio/altera_ps2.c
index d363dc4..35864c6 100644
--- a/drivers/input/serio/altera_ps2.c
+++ b/drivers/input/serio/altera_ps2.c
@@ -196,18 +196,7 @@ static struct platform_driver altera_ps2_driver = {
.of_match_table = altera_ps2_match,
},
};
-
-static int __init altera_ps2_init(void)
-{
- return platform_driver_register(&altera_ps2_driver);
-}
-module_init(altera_ps2_init);
-
-static void __exit altera_ps2_exit(void)
-{
- platform_driver_unregister(&altera_ps2_driver);
-}
-module_exit(altera_ps2_exit);
+module_platform_driver(altera_ps2_driver);
MODULE_DESCRIPTION("Altera University Program PS2 controller driver");
MODULE_AUTHOR("Thomas Chou <thomas@wytron.com.tw>");
diff --git a/drivers/input/serio/at32psif.c b/drivers/input/serio/at32psif.c
index 95280f9..421a744 100644
--- a/drivers/input/serio/at32psif.c
+++ b/drivers/input/serio/at32psif.c
@@ -358,19 +358,7 @@ static struct platform_driver psif_driver = {
.suspend = psif_suspend,
.resume = psif_resume,
};
-
-static int __init psif_init(void)
-{
- return platform_driver_probe(&psif_driver, psif_probe);
-}
-
-static void __exit psif_exit(void)
-{
- platform_driver_unregister(&psif_driver);
-}
-
-module_init(psif_init);
-module_exit(psif_exit);
+module_platform_driver(psif_driver);
MODULE_AUTHOR("Hans-Christian Egtvedt <egtvedt@samfundet.no>");
MODULE_DESCRIPTION("Atmel AVR32 PSIF PS/2 driver");
diff --git a/drivers/input/serio/rpckbd.c b/drivers/input/serio/rpckbd.c
index 7ec3c97..8b44ddc 100644
--- a/drivers/input/serio/rpckbd.c
+++ b/drivers/input/serio/rpckbd.c
@@ -143,16 +143,4 @@ static struct platform_driver rpckbd_driver = {
.owner = THIS_MODULE,
},
};
-
-static int __init rpckbd_init(void)
-{
- return platform_driver_register(&rpckbd_driver);
-}
-
-static void __exit rpckbd_exit(void)
-{
- platform_driver_unregister(&rpckbd_driver);
-}
-
-module_init(rpckbd_init);
-module_exit(rpckbd_exit);
+module_platform_driver(rpckbd_driver);
diff --git a/drivers/input/serio/xilinx_ps2.c b/drivers/input/serio/xilinx_ps2.c
index d64c5a4..127c391 100644
--- a/drivers/input/serio/xilinx_ps2.c
+++ b/drivers/input/serio/xilinx_ps2.c
@@ -369,19 +369,7 @@ static struct platform_driver xps2_of_driver = {
.probe = xps2_of_probe,
.remove = __devexit_p(xps2_of_remove),
};
-
-static int __init xps2_init(void)
-{
- return platform_driver_register(&xps2_of_driver);
-}
-
-static void __exit xps2_cleanup(void)
-{
- platform_driver_unregister(&xps2_of_driver);
-}
-
-module_init(xps2_init);
-module_exit(xps2_cleanup);
+module_platform_driver(xps2_of_driver);
MODULE_AUTHOR("Xilinx, Inc.");
MODULE_DESCRIPTION("Xilinx XPS PS/2 driver");
--
1.7.8-rc2
next prev parent reply other threads:[~2011-11-22 9:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-22 9:00 [PATCH TRIVIAL 0/5] Input: use new macro module_platform_driver to save some boilerplate code JJ Ding
2011-11-22 9:00 ` [PATCH TRIVIAL 1/5] Input: keyboard: use macro module_platform_driver() JJ Ding
2011-11-22 9:23 ` Linus Walleij
2011-11-22 15:00 ` Mike Frysinger
2011-11-22 20:15 ` H Hartley Sweeten
2012-01-10 20:47 ` Geert Uytterhoeven
2012-01-10 20:57 ` Geert Uytterhoeven
2012-01-10 22:22 ` Dmitry Torokhov
2012-01-10 23:07 ` Dmitry Torokhov
2012-01-11 2:07 ` JJ Ding
2011-11-22 9:00 ` [PATCH TRIVIAL 2/5] Input: misc: " JJ Ding
2011-11-22 14:59 ` Mike Frysinger
2011-11-22 9:00 ` [PATCH TRIVIAL 3/5] Input: mouse: " JJ Ding
2011-11-22 9:00 ` JJ Ding [this message]
2011-11-22 9:00 ` [PATCH TRIVIAL 5/5] Input: touchscreen: " JJ Ding
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=1321952446-7591-5-git-send-email-jj_ding@emc.com.tw \
--to=jj_ding@emc.com.tw \
--cc=dgdunix@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=grant.likely@secretlab.ca \
--cc=gregkh@suse.de \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.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
all inboxes | Powered by JetHome®