Patchwork [1/2] net: ks8851: Use module_spi_driver

login
register
mail settings
Submitter Lars-Peter Clausen
Date April 7, 2013, 9:33 a.m.
Message ID <1365327184-22956-1-git-send-email-lars@metafoo.de>
Download mbox | patch
Permalink /patch/234465/
State Accepted
Delegated to: David Miller
Headers show

Comments

Lars-Peter Clausen - April 7, 2013, 9:33 a.m.
By using module_spi_driver we can eliminate a few lines of boilerplate code.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/net/ethernet/micrel/ks8851.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)
David Miller - April 8, 2013, 8:56 p.m.
From: Lars-Peter Clausen <lars@metafoo.de>
Date: Sun,  7 Apr 2013 11:33:03 +0200

> By using module_spi_driver we can eliminate a few lines of boilerplate code.
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

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/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 8fb4812..84ca876 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -1538,19 +1538,7 @@  static struct spi_driver ks8851_driver = {
 	.suspend = ks8851_suspend,
 	.resume = ks8851_resume,
 };
-
-static int __init ks8851_init(void)
-{
-	return spi_register_driver(&ks8851_driver);
-}
-
-static void __exit ks8851_exit(void)
-{
-	spi_unregister_driver(&ks8851_driver);
-}
-
-module_init(ks8851_init);
-module_exit(ks8851_exit);
+module_spi_driver(ks8851_driver);
 
 MODULE_DESCRIPTION("KS8851 Network driver");
 MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");