net/can: use module_pci_driver
authorAxel Lin <axel.lin@gmail.com>
Sat, 14 Apr 2012 04:38:43 +0000 (12:38 +0800)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 16 Apr 2012 19:08:18 +0000 (21:08 +0200)
This patch converts the drivers in drivers/net/can/* 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: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: linux-can@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/pch_can.c
drivers/net/can/sja1000/ems_pci.c
drivers/net/can/sja1000/kvaser_pci.c
drivers/net/can/sja1000/peak_pci.c
drivers/net/can/sja1000/plx_pci.c

index 2bb215e00eb120feb7bac1d3c094aa8f2989fffd..1226297e7676aab20bc65f6e716f0b12299e7812 100644 (file)
@@ -1274,17 +1274,7 @@ static struct pci_driver pch_can_pci_driver = {
        .resume = pch_can_resume,
 };
 
-static int __init pch_can_pci_init(void)
-{
-       return pci_register_driver(&pch_can_pci_driver);
-}
-module_init(pch_can_pci_init);
-
-static void __exit pch_can_pci_exit(void)
-{
-       pci_unregister_driver(&pch_can_pci_driver);
-}
-module_exit(pch_can_pci_exit);
+module_pci_driver(pch_can_pci_driver);
 
 MODULE_DESCRIPTION("Intel EG20T PCH CAN(Controller Area Network) Driver");
 MODULE_LICENSE("GPL v2");
index 36f4f9780c300c3952e5889e960de3ddb75e8b45..5c6d412bafb505f0379ca0ae7f3f2eb5691ad8c8 100644 (file)
@@ -371,16 +371,4 @@ static struct pci_driver ems_pci_driver = {
        .remove = ems_pci_del_card,
 };
 
-static int __init ems_pci_init(void)
-{
-       return pci_register_driver(&ems_pci_driver);
-}
-
-static void __exit ems_pci_exit(void)
-{
-       pci_unregister_driver(&ems_pci_driver);
-}
-
-module_init(ems_pci_init);
-module_exit(ems_pci_exit);
-
+module_pci_driver(ems_pci_driver);
index ed004cebd31f0dc46b79f34c41893d279d5e41a2..23ed6ea4c7c350cb9a232d15e8a9d792a9e04cfa 100644 (file)
@@ -397,15 +397,4 @@ static struct pci_driver kvaser_pci_driver = {
        .remove = __devexit_p(kvaser_pci_remove_one),
 };
 
-static int __init kvaser_pci_init(void)
-{
-       return pci_register_driver(&kvaser_pci_driver);
-}
-
-static void __exit kvaser_pci_exit(void)
-{
-       pci_unregister_driver(&kvaser_pci_driver);
-}
-
-module_init(kvaser_pci_init);
-module_exit(kvaser_pci_exit);
+module_pci_driver(kvaser_pci_driver);
index 5f92b865f64be4afcc855b5598a5dc8c719a5421..f0a12962f7b68df338dc3a627317e77975741382 100644 (file)
@@ -749,14 +749,4 @@ static struct pci_driver peak_pci_driver = {
        .remove = __devexit_p(peak_pci_remove),
 };
 
-static int __init peak_pci_init(void)
-{
-       return pci_register_driver(&peak_pci_driver);
-}
-module_init(peak_pci_init);
-
-static void __exit peak_pci_exit(void)
-{
-       pci_unregister_driver(&peak_pci_driver);
-}
-module_exit(peak_pci_exit);
+module_pci_driver(peak_pci_driver);
index a227586ddd52a6e16a835f5da903963ac748eef6..8bc95982840fadfcd88952255e75220bea7fd9b1 100644 (file)
@@ -609,15 +609,4 @@ static struct pci_driver plx_pci_driver = {
        .remove = plx_pci_del_card,
 };
 
-static int __init plx_pci_init(void)
-{
-       return pci_register_driver(&plx_pci_driver);
-}
-
-static void __exit plx_pci_exit(void)
-{
-       pci_unregister_driver(&plx_pci_driver);
-}
-
-module_init(plx_pci_init);
-module_exit(plx_pci_exit);
+module_pci_driver(plx_pci_driver);