Skip to contentSkip to conversation

staging/tidspbridge: use module_platform_driver

PATCH Applied Devendra Naga 2 participants 2 messages Jul 21, 2012 – Jul 24, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 staging/tidspbridge: use module_platform_driver

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

---

 drivers/staging/tidspbridge/rmgr/drv_interface.c |   14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
drivers/staging/tidspbridge/rmgr/drv_interface.c +1 -13
index 3cac014..6acea2b 100644
@@ -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);
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 7 lines · 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

FWIW, looks good to me.

Cheers,

Omar