net: wireless: p54spi: Use module_spi_driver macro
authorSachin Kamat <sachin.kamat@linaro.org>
Wed, 29 May 2013 10:01:40 +0000 (15:31 +0530)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 29 May 2013 19:22:44 +0000 (15:22 -0400)
module_spi_driver() eliminates some boiler plate and makes code
simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/p54/p54spi.c

index 978e7eb26567fc14cfe2a86faa294670f90e13ad..146e6530ae29b52b8161e8280b7cde332a960b14 100644 (file)
@@ -713,27 +713,7 @@ static struct spi_driver p54spi_driver = {
        .remove         = p54spi_remove,
 };
 
-static int __init p54spi_init(void)
-{
-       int ret;
-
-       ret = spi_register_driver(&p54spi_driver);
-       if (ret < 0) {
-               printk(KERN_ERR "failed to register SPI driver: %d", ret);
-               goto out;
-       }
-
-out:
-       return ret;
-}
-
-static void __exit p54spi_exit(void)
-{
-       spi_unregister_driver(&p54spi_driver);
-}
-
-module_init(p54spi_init);
-module_exit(p54spi_exit);
+module_spi_driver(p54spi_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Christian Lamparter <chunkeey@web.de>");