Patchwork [-next] mrf24j40: use module_spi_driver to simplify the code

login
register
mail settings
Submitter Wei Yongjun
Date April 9, 2013, 6:34 a.m.
Message ID <CAPgLHd_Ci0u45-C0y7NV66zim8zZgBY+VjmW2iBdgG2OoL5CyA@mail.gmail.com>
Download mbox | patch
Permalink /patch/234972/
State Accepted
Delegated to: David Miller
Headers show

Comments

Wei Yongjun - April 9, 2013, 6:34 a.m.
From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

module_spi_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
---
 drivers/net/ieee802154/mrf24j40.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - April 9, 2013, 5:20 p.m.
From: Wei Yongjun <weiyj.lk@gmail.com>
Date: Tue, 9 Apr 2013 14:34:44 +0800

> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> 
> module_spi_driver() makes the code simpler by eliminating
> boilerplate code.
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index ca00351..eca7165 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -756,18 +756,7 @@  static struct spi_driver mrf24j40_driver = {
 	.remove = mrf24j40_remove,
 };
 
-static int __init mrf24j40_init(void)
-{
-	return spi_register_driver(&mrf24j40_driver);
-}
-
-static void __exit mrf24j40_exit(void)
-{
-	spi_unregister_driver(&mrf24j40_driver);
-}
-
-module_init(mrf24j40_init);
-module_exit(mrf24j40_exit);
+module_spi_driver(mrf24j40_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Alan Ott");