can: mcp251x: Use module_spi_driver
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 12 Mar 2013 12:13:52 +0000 (13:13 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 27 Mar 2013 12:07:09 +0000 (13:07 +0100)
By using module_spi_driver we can eliminate a few lines of boilerplate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/mcp251x.c

index 05e93e8..4dc7b9d 100644 (file)
@@ -1216,19 +1216,7 @@ static struct spi_driver mcp251x_can_driver = {
        .suspend = mcp251x_can_suspend,
        .resume = mcp251x_can_resume,
 };
-
-static int __init mcp251x_can_init(void)
-{
-       return spi_register_driver(&mcp251x_can_driver);
-}
-
-static void __exit mcp251x_can_exit(void)
-{
-       spi_unregister_driver(&mcp251x_can_driver);
-}
-
-module_init(mcp251x_can_init);
-module_exit(mcp251x_can_exit);
+module_spi_driver(mcp251x_can_driver);
 
 MODULE_AUTHOR("Chris Elston <celston@katalix.com>, "
              "Christian Pellegrin <chripell@evolware.org>");