coresight-tmc: use module_amba_driver to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 9 Jan 2015 23:57:15 +0000 (16:57 -0700)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Mon, 2 Mar 2015 18:33:27 +0000 (11:33 -0700)
module_amba_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit d2e580c272d19afff768b56dd0f5d2095cb5a07c)
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
drivers/coresight/coresight-tmc.c

index ce2c293f17074eea85ba9c1a9bb537ac22a230b7..3ff232f9ddf78c5a3c4f6146b1ec2dac7aef87b0 100644 (file)
@@ -760,17 +760,7 @@ static struct amba_driver tmc_driver = {
        .id_table       = tmc_ids,
 };
 
-static int __init tmc_init(void)
-{
-       return amba_driver_register(&tmc_driver);
-}
-module_init(tmc_init);
-
-static void __exit tmc_exit(void)
-{
-       amba_driver_unregister(&tmc_driver);
-}
-module_exit(tmc_exit);
+module_amba_driver(tmc_driver);
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("CoreSight Trace Memory Controller driver");