linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: touchscreen: mc13783_ts.c: Convert to platform driver
@ 2013-01-07 20:32 Fabio Estevam
  2013-01-07 20:50 ` Dmitry Torokhov
  0 siblings, 1 reply; 5+ messages in thread
From: Fabio Estevam @ 2013-01-07 20:32 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: s.hauer, linux-input, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Using module_platform_driver() can make the code smaller and cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/input/touchscreen/mc13783_ts.c |   13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c
index 02103b6..e881c25 100644
--- a/drivers/input/touchscreen/mc13783_ts.c
+++ b/drivers/input/touchscreen/mc13783_ts.c
@@ -243,6 +243,7 @@ static int mc13783_ts_remove(struct platform_device *pdev)
 }
 
 static struct platform_driver mc13783_ts_driver = {
+	.probe		= mc13783_ts_probe,
 	.remove		= mc13783_ts_remove,
 	.driver		= {
 		.owner	= THIS_MODULE,
@@ -250,17 +251,7 @@ static struct platform_driver mc13783_ts_driver = {
 	},
 };
 
-static int __init mc13783_ts_init(void)
-{
-	return platform_driver_probe(&mc13783_ts_driver, &mc13783_ts_probe);
-}
-module_init(mc13783_ts_init);
-
-static void __exit mc13783_ts_exit(void)
-{
-	platform_driver_unregister(&mc13783_ts_driver);
-}
-module_exit(mc13783_ts_exit);
+module_platform_driver(mc13783_ts_driver);
 
 MODULE_DESCRIPTION("MC13783 input touchscreen driver");
 MODULE_AUTHOR("Sascha Hauer <s.hauer@pengutronix.de>");
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-01-07 21:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-07 20:32 [PATCH] Input: touchscreen: mc13783_ts.c: Convert to platform driver Fabio Estevam
2013-01-07 20:50 ` Dmitry Torokhov
2013-01-07 20:55   ` Fabio Estevam
2013-01-07 20:59     ` Dmitry Torokhov
2013-01-07 21:01       ` Fabio Estevam

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).