Input: touchscreen: mc13783_ts.c: Convert to platform driver
Subsystems (2)
PATCH 1/1 Input: touchscreen: mc13783_ts.c: Convert to platform driver
From: Fabio Estevam <[email protected]>
Using module_platform_driver() can make the code smaller and cleaner.
--- drivers/input/touchscreen/mc13783_ts.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/input/touchscreen/mc13783_ts.c +2 -11
@@ -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 <[email protected]>" );
Signature · 1 line
1.7.9.5
Dmitry Torokhov
maintainerHi Fabio,
Quoted 27 lines · Fabio Estevam
From: Fabio Estevam <[email protected]>
Using
module_platform_driver()can make the code smaller and cleaner.Signed-off-by Fabio Estevam <[email protected]>--- drivers/input/touchscreen/mc13783_ts.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)drivers/input/touchscreen/mc13783_ts.c +1
-2@@ -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 ) -{
drivers/input/touchscreen/mc13783_ts.c static struct platform_driver mc13783_ts_driver = { · line 254
Quoted 10 lines
drivers/input/touchscreen/mc13783_ts.c +1
-9-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);
This is not equivalent transformation. Did you intend to change the behavior? If you this should be mentioned (and reasoned) in the patch description.
Thanks.
Signature · 1 line
Dmitry
Hi Dmitry,
Quoted 3 lines · Dmitry Torokhov
This is not equivalent transformation. Did you intend to change the behavior? If you this should be mentioned (and reasoned) in the patch description.
Sorry, do not understand why the behavior changes? Can you please explain?
Dmitry Torokhov
maintainerQuoted 10 lines · Fabio Estevam
Hi Dmitry,
Quoted 3 lines · Dmitry Torokhov
This is not equivalent transformation. Did you intend to change the behavior? If you this should be mentioned (and reasoned) in the patch description.
Sorry, do not understand why the behavior changes? Can you please explain?
module_platform_driver() internally uses platform_driver_register() whereas the original code used platform_driver_probe(). These 2 behave differently.
Signature · 1 line
Dmitry
Quoted 3 lines · Dmitry Torokhov
module_platform_driver()internally usesplatform_driver_register()whereas the original code usedplatform_driver_probe(). These 2 behave differently.
Ok, got it. Please discard it.