net/tokenring: use module_pci_driver
authorAxel Lin <axel.lin@gmail.com>
Fri, 13 Apr 2012 18:40:17 +0000 (18:40 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 14 Apr 2012 19:20:04 +0000 (15:20 -0400)
This patch converts the drivers in drivers/net/tokenring/* to use
module_pci_driver() macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tokenring/3c359.c
drivers/net/tokenring/lanstreamer.c
drivers/net/tokenring/olympic.c
drivers/net/tokenring/tmspci.c

index b15ac81d46fafeea5d8db7c25180991a707acd3c..0924f572f59bef036a031e394cee7e32128c2295 100644 (file)
@@ -1826,18 +1826,6 @@ static struct pci_driver xl_3c359_driver = {
        .remove         = __devexit_p(xl_remove_one),
 };
 
-static int __init xl_pci_init (void)
-{
-       return pci_register_driver(&xl_3c359_driver);
-}
-
-
-static void __exit xl_pci_cleanup (void)
-{
-       pci_unregister_driver (&xl_3c359_driver);
-}
-
-module_init(xl_pci_init);
-module_exit(xl_pci_cleanup);
+module_pci_driver(xl_3c359_driver);
 
 MODULE_LICENSE("GPL") ; 
index 3e4b4f091113e0ffe6712689276e06c1fd0fac44..97e4c65c1e29e490c4b2a2933cb35e92f1b655fc 100644 (file)
@@ -1904,14 +1904,6 @@ static struct pci_driver streamer_pci_driver = {
   .remove   = __devexit_p(streamer_remove_one),
 };
 
-static int __init streamer_init_module(void) {
-  return pci_register_driver(&streamer_pci_driver);
-}
-
-static void __exit streamer_cleanup_module(void) {
-  pci_unregister_driver(&streamer_pci_driver);
-}
+module_pci_driver(streamer_pci_driver);
 
-module_init(streamer_init_module);
-module_exit(streamer_cleanup_module);
 MODULE_LICENSE("GPL");
index 0e234741cc791af3ca5d6d372862c297e51f5cfe..4d45fe8bd206254eb039dbafcd476ef15514f8a3 100644 (file)
@@ -1732,18 +1732,6 @@ static struct pci_driver olympic_driver = {
        .remove         = __devexit_p(olympic_remove_one),
 };
 
-static int __init olympic_pci_init(void) 
-{
-       return pci_register_driver(&olympic_driver) ;
-}
-
-static void __exit olympic_pci_cleanup(void)
-{
-       pci_unregister_driver(&olympic_driver) ; 
-}      
-
-
-module_init(olympic_pci_init) ; 
-module_exit(olympic_pci_cleanup) ; 
+module_pci_driver(olympic_driver);
 
 MODULE_LICENSE("GPL");
index fb9918da5792916f63ed8f26aa84e8f3f6e60c2c..90f3fa44a151393bb309f87e00538c9cb6cd33b0 100644 (file)
@@ -233,16 +233,4 @@ static struct pci_driver tms_pci_driver = {
        .remove         = __devexit_p(tms_pci_detach),
 };
 
-static int __init tms_pci_init (void)
-{
-       return pci_register_driver(&tms_pci_driver);
-}
-
-static void __exit tms_pci_rmmod (void)
-{
-       pci_unregister_driver (&tms_pci_driver);
-}
-
-module_init(tms_pci_init);
-module_exit(tms_pci_rmmod);
-
+module_pci_driver(tms_pci_driver);