mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/2] staging/tidspbridge: use module_platform_driver
@ 2012-07-21  8:56 Devendra Naga
  2012-07-24 17:41 ` Ramirez Luna, Omar
  0 siblings, 1 reply; 2+ messages in thread
From: Devendra Naga @ 2012-07-21  8:56 UTC (permalink / raw)
  To: Omar Ramirez Luna, Greg Kroah-Hartman,
	Víctor Manuel Jáquez Leal, devel, linux-kernel
  Cc: Devendra Naga

the code under _init and _exit does platform_driver_register and
platform_driver_unregister respectively only,

so its better to use the module_platform_driver than just replicating
the module_platform_driver's implementation

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
---

 drivers/staging/tidspbridge/rmgr/drv_interface.c |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/staging/tidspbridge/rmgr/drv_interface.c b/drivers/staging/tidspbridge/rmgr/drv_interface.c
index 3cac014..6acea2b 100644
--- a/drivers/staging/tidspbridge/rmgr/drv_interface.c
+++ b/drivers/staging/tidspbridge/rmgr/drv_interface.c
@@ -613,16 +613,6 @@ static struct platform_driver bridge_driver = {
 #endif
 };
 
-static int __init bridge_init(void)
-{
-	return platform_driver_register(&bridge_driver);
-}
-
-static void __exit bridge_exit(void)
-{
-	platform_driver_unregister(&bridge_driver);
-}
-
 /* To remove all process resources before removing the process from the
  * process context list */
 int drv_remove_all_resources(void *process_ctxt)
@@ -636,6 +626,4 @@ int drv_remove_all_resources(void *process_ctxt)
 	return status;
 }
 
-/* Bridge driver initialization and de-initialization functions */
-module_init(bridge_init);
-module_exit(bridge_exit);
+module_platform_driver(bridge_driver);
-- 
1.7.9.5


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

* Re: [PATCH 2/2] staging/tidspbridge: use module_platform_driver
  2012-07-21  8:56 [PATCH 2/2] staging/tidspbridge: use module_platform_driver Devendra Naga
@ 2012-07-24 17:41 ` Ramirez Luna, Omar
  0 siblings, 0 replies; 2+ messages in thread
From: Ramirez Luna, Omar @ 2012-07-24 17:41 UTC (permalink / raw)
  To: Devendra Naga
  Cc: Greg Kroah-Hartman, Víctor Manuel Jáquez Leal, devel,
	linux-kernel

On Sat, Jul 21, 2012 at 3:56 AM, Devendra Naga
<develkernel412222@gmail.com> wrote:
> the code under _init and _exit does platform_driver_register and
> platform_driver_unregister respectively only,
>
> so its better to use the module_platform_driver than just replicating
> the module_platform_driver's implementation
>
> Signed-off-by: Devendra Naga <develkernel412222@gmail.com>

FWIW, looks good to me.

Cheers,

Omar

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

end of thread, other threads:[~2012-07-24 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21  8:56 [PATCH 2/2] staging/tidspbridge: use module_platform_driver Devendra Naga
2012-07-24 17:41 ` Ramirez Luna, Omar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome