i2c/busses: Use module_pci_driver
authorAxel Lin <axel.lin@gmail.com>
Tue, 24 Jul 2012 12:13:56 +0000 (14:13 +0200)
committerJean Delvare <khali@endymion.delvare>
Tue, 24 Jul 2012 12:13:56 +0000 (14:13 +0200)
Convert the drivers in drivers/i2c/busses/* to usemodule_pci_driver()
macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Rudolf Marek <r.marek@assembler.cz>
Cc: Olof Johansson <olof@lixom.net>
Cc: "Mark M. Hoffman" <mhoffman@lightlink.com>
Cc: Tomoya MORINAGA <tomoya.rohm@gmail.com>
16 files changed:
drivers/i2c/busses/i2c-ali1535.c
drivers/i2c/busses/i2c-ali1563.c
drivers/i2c/busses/i2c-ali15x3.c
drivers/i2c/busses/i2c-amd756.c
drivers/i2c/busses/i2c-amd8111.c
drivers/i2c/busses/i2c-designware-pcidrv.c
drivers/i2c/busses/i2c-eg20t.c
drivers/i2c/busses/i2c-hydra.c
drivers/i2c/busses/i2c-intel-mid.c
drivers/i2c/busses/i2c-nforce2.c
drivers/i2c/busses/i2c-pasemi.c
drivers/i2c/busses/i2c-piix4.c
drivers/i2c/busses/i2c-pxa-pci.c
drivers/i2c/busses/i2c-sis630.c
drivers/i2c/busses/i2c-sis96x.c
drivers/i2c/busses/i2c-via.c

index e66d248fc126b8ffe4f9d85e45f82a76c5ee9bf7..125cd8e0ad25c69c1206298d421e74da48284efe 100644 (file)
@@ -531,15 +531,7 @@ static struct pci_driver ali1535_driver = {
        .remove         = __devexit_p(ali1535_remove),
 };
 
-static int __init i2c_ali1535_init(void)
-{
-       return pci_register_driver(&ali1535_driver);
-}
-
-static void __exit i2c_ali1535_exit(void)
-{
-       pci_unregister_driver(&ali1535_driver);
-}
+module_pci_driver(ali1535_driver);
 
 MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>, "
              "Philip Edelbrock <phil@netroedge.com>, "
@@ -547,6 +539,3 @@ MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>, "
              "and Dan Eaton <dan.eaton@rocketlogix.com>");
 MODULE_DESCRIPTION("ALI1535 SMBus driver");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_ali1535_init);
-module_exit(i2c_ali1535_exit);
index 47ae0091e027dbab7b11e83b7924e7a2fc016027..e02d9f86c6a0ad22a573f18b6f371cd1b2f1fc25 100644 (file)
@@ -431,18 +431,6 @@ static struct pci_driver ali1563_pci_driver = {
        .remove         = __devexit_p(ali1563_remove),
 };
 
-static int __init ali1563_init(void)
-{
-       return pci_register_driver(&ali1563_pci_driver);
-}
-
-module_init(ali1563_init);
-
-static void __exit ali1563_exit(void)
-{
-       pci_unregister_driver(&ali1563_pci_driver);
-}
-
-module_exit(ali1563_exit);
+module_pci_driver(ali1563_pci_driver);
 
 MODULE_LICENSE("GPL");
index 087ea9caa74d3ac34b4ced643c0b8303aba6474e..ce8d26d053a5650434ee63fc31831b11278150b9 100644 (file)
@@ -513,21 +513,10 @@ static struct pci_driver ali15x3_driver = {
        .remove         = __devexit_p(ali15x3_remove),
 };
 
-static int __init i2c_ali15x3_init(void)
-{
-       return pci_register_driver(&ali15x3_driver);
-}
-
-static void __exit i2c_ali15x3_exit(void)
-{
-       pci_unregister_driver(&ali15x3_driver);
-}
+module_pci_driver(ali15x3_driver);
 
 MODULE_AUTHOR ("Frodo Looijaard <frodol@dds.nl>, "
                "Philip Edelbrock <phil@netroedge.com>, "
                "and Mark D. Studebaker <mdsxyz123@yahoo.com>");
 MODULE_DESCRIPTION("ALI15X3 SMBus driver");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_ali15x3_init);
-module_exit(i2c_ali15x3_exit);
index eb778bf15c18539f579a6d435d4d0410fe1e4bce..304aa03b57b25f5efca7f771ba7f5a4a7cbece41 100644 (file)
@@ -410,21 +410,10 @@ static struct pci_driver amd756_driver = {
        .remove         = __devexit_p(amd756_remove),
 };
 
-static int __init amd756_init(void)
-{
-       return pci_register_driver(&amd756_driver);
-}
-
-static void __exit amd756_exit(void)
-{
-       pci_unregister_driver(&amd756_driver);
-}
+module_pci_driver(amd756_driver);
 
 MODULE_AUTHOR("Merlin Hughes <merlin@merlin.org>");
 MODULE_DESCRIPTION("AMD756/766/768/8111 and nVidia nForce SMBus driver");
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(amd756_smbus);
-
-module_init(amd756_init)
-module_exit(amd756_exit)
index e5ac53b99b0473703b8408bdde663ddd207f2b70..0919ac1d99aacab197bbecf13ef944f4b88d4074 100644 (file)
@@ -491,15 +491,4 @@ static struct pci_driver amd8111_driver = {
        .remove         = __devexit_p(amd8111_remove),
 };
 
-static int __init i2c_amd8111_init(void)
-{
-       return pci_register_driver(&amd8111_driver);
-}
-
-static void __exit i2c_amd8111_exit(void)
-{
-       pci_unregister_driver(&amd8111_driver);
-}
-
-module_init(i2c_amd8111_init);
-module_exit(i2c_amd8111_exit);
+module_pci_driver(amd8111_driver);
index 00e8f213f56e51ed15b12b551af627eff9ef00b7..92a1e2c15baad8e3875337cde50dc132acd06a7d 100644 (file)
@@ -374,17 +374,7 @@ static struct pci_driver dw_i2c_driver = {
        },
 };
 
-static int __init dw_i2c_init_driver(void)
-{
-       return  pci_register_driver(&dw_i2c_driver);
-}
-module_init(dw_i2c_init_driver);
-
-static void __exit dw_i2c_exit_driver(void)
-{
-       pci_unregister_driver(&dw_i2c_driver);
-}
-module_exit(dw_i2c_exit_driver);
+module_pci_driver(dw_i2c_driver);
 
 MODULE_AUTHOR("Baruch Siach <baruch@tkos.co.il>");
 MODULE_DESCRIPTION("Synopsys DesignWare PCI I2C bus adapter");
index 2f74ae872e1e5512239a9e045b19e31e797507b1..259f7697bf25388085e9efd2bbd5a57e78943962 100644 (file)
@@ -953,17 +953,7 @@ static struct pci_driver pch_pcidriver = {
        .resume = pch_i2c_resume
 };
 
-static int __init pch_pci_init(void)
-{
-       return pci_register_driver(&pch_pcidriver);
-}
-module_init(pch_pci_init);
-
-static void __exit pch_pci_exit(void)
-{
-       pci_unregister_driver(&pch_pcidriver);
-}
-module_exit(pch_pci_exit);
+module_pci_driver(pch_pcidriver);
 
 MODULE_DESCRIPTION("Intel EG20T PCH/LAPIS Semico ML7213/ML7223/ML7831 IOH I2C");
 MODULE_LICENSE("GPL");
index c527de17db4f25d8c539cefd2f3d2661b4e12fbf..c9f95e1666a8fe6a84a8a0765424b67ba4ca25a3 100644 (file)
@@ -156,23 +156,8 @@ static struct pci_driver hydra_driver = {
        .remove         = __devexit_p(hydra_remove),
 };
 
-static int __init i2c_hydra_init(void)
-{
-       return pci_register_driver(&hydra_driver);
-}
-
-
-static void __exit i2c_hydra_exit(void)
-{
-       pci_unregister_driver(&hydra_driver);
-}
-
-
+module_pci_driver(hydra_driver);
 
 MODULE_AUTHOR("Geert Uytterhoeven <geert@linux-m68k.org>");
 MODULE_DESCRIPTION("i2c for Apple Hydra Mac I/O");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_hydra_init);
-module_exit(i2c_hydra_exit);
-
index 365bad5b890b7ed6001ab48de51a17505056a789..7c28f10f95ca2f380e4c1db9469b864bdd9af26b 100644 (file)
@@ -1116,18 +1116,7 @@ static struct pci_driver intel_mid_i2c_driver = {
        .remove         = __devexit_p(intel_mid_i2c_remove),
 };
 
-static int __init intel_mid_i2c_init(void)
-{
-       return pci_register_driver(&intel_mid_i2c_driver);
-}
-
-static void __exit intel_mid_i2c_exit(void)
-{
-       pci_unregister_driver(&intel_mid_i2c_driver);
-}
-
-module_init(intel_mid_i2c_init);
-module_exit(intel_mid_i2c_exit);
+module_pci_driver(intel_mid_i2c_driver);
 
 MODULE_AUTHOR("Ba Zheng <zheng.ba@intel.com>");
 MODULE_DESCRIPTION("I2C driver for Moorestown Platform");
index 43a96a123920c8d75773735b3070e7b4872ddd62..392303b4be075f643d101803f10ea6dafdb7e41f 100644 (file)
@@ -453,16 +453,4 @@ static struct pci_driver nforce2_driver = {
        .remove         = __devexit_p(nforce2_remove),
 };
 
-static int __init nforce2_init(void)
-{
-       return pci_register_driver(&nforce2_driver);
-}
-
-static void __exit nforce2_exit(void)
-{
-       pci_unregister_driver(&nforce2_driver);
-}
-
-module_init(nforce2_init);
-module_exit(nforce2_exit);
-
+module_pci_driver(nforce2_driver);
index eaaea73209c5ca5d81a0aec5b389d0520cba850d..12edefd4183a4c72d0b1e26cdd7183906f5e7f53 100644 (file)
@@ -415,19 +415,8 @@ static struct pci_driver pasemi_smb_driver = {
        .remove         = __devexit_p(pasemi_smb_remove),
 };
 
-static int __init pasemi_smb_init(void)
-{
-       return pci_register_driver(&pasemi_smb_driver);
-}
-
-static void __exit pasemi_smb_exit(void)
-{
-       pci_unregister_driver(&pasemi_smb_driver);
-}
+module_pci_driver(pasemi_smb_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR ("Olof Johansson <olof@lixom.net>");
 MODULE_DESCRIPTION("PA Semi PWRficient SMBus driver");
-
-module_init(pasemi_smb_init);
-module_exit(pasemi_smb_exit);
index c14d48dd601a7d524ab97c8fff076867f21bae05..46833fa7a3e043a8ecbb8e6eee25243167f7e87c 100644 (file)
@@ -544,20 +544,9 @@ static struct pci_driver piix4_driver = {
        .remove         = __devexit_p(piix4_remove),
 };
 
-static int __init i2c_piix4_init(void)
-{
-       return pci_register_driver(&piix4_driver);
-}
-
-static void __exit i2c_piix4_exit(void)
-{
-       pci_unregister_driver(&piix4_driver);
-}
+module_pci_driver(piix4_driver);
 
 MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl> and "
                "Philip Edelbrock <phil@netroedge.com>");
 MODULE_DESCRIPTION("PIIX4 SMBus driver");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_piix4_init);
-module_exit(i2c_piix4_exit);
index a05817980556542d77a9e4463060fb8e7fc6ab5d..4dc9bef17d77f78fbdc92b076944fc8621f5410e 100644 (file)
@@ -163,17 +163,7 @@ static struct pci_driver ce4100_i2c_driver = {
        .remove         = __devexit_p(ce4100_i2c_remove),
 };
 
-static int __init ce4100_i2c_init(void)
-{
-       return pci_register_driver(&ce4100_i2c_driver);
-}
-module_init(ce4100_i2c_init);
-
-static void __exit ce4100_i2c_exit(void)
-{
-       pci_unregister_driver(&ce4100_i2c_driver);
-}
-module_exit(ce4100_i2c_exit);
+module_pci_driver(ce4100_i2c_driver);
 
 MODULE_DESCRIPTION("CE4100 PCI-I2C glue code for PXA's driver");
 MODULE_LICENSE("GPL v2");
index 15cf78f65ce0f087236835ed877d55b8b69a4082..5d6723b7525ed547d0e88f6ff1d7f5b47148be6e 100644 (file)
@@ -513,21 +513,8 @@ static struct pci_driver sis630_driver = {
        .remove         = __devexit_p(sis630_remove),
 };
 
-static int __init i2c_sis630_init(void)
-{
-       return pci_register_driver(&sis630_driver);
-}
-
-
-static void __exit i2c_sis630_exit(void)
-{
-       pci_unregister_driver(&sis630_driver);
-}
-
+module_pci_driver(sis630_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Alexander Malysh <amalysh@web.de>");
 MODULE_DESCRIPTION("SIS630 SMBus driver");
-
-module_init(i2c_sis630_init);
-module_exit(i2c_sis630_exit);
index cc5d149413f7edb236ca48f57af155aaef5fefd9..7b72614a9bc0adde27d469fb305622952ac56e94 100644 (file)
@@ -324,21 +324,8 @@ static struct pci_driver sis96x_driver = {
        .remove         = __devexit_p(sis96x_remove),
 };
 
-static int __init i2c_sis96x_init(void)
-{
-       return pci_register_driver(&sis96x_driver);
-}
-
-static void __exit i2c_sis96x_exit(void)
-{
-       pci_unregister_driver(&sis96x_driver);
-}
+module_pci_driver(sis96x_driver);
 
 MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>");
 MODULE_DESCRIPTION("SiS96x SMBus driver");
 MODULE_LICENSE("GPL");
-
-/* Register initialization functions using helper macros */
-module_init(i2c_sis96x_init);
-module_exit(i2c_sis96x_exit);
-
index 713d31ade26b7ca8f77f2fa6be99757cb6af3299..7ffee71ca19051afffde5c5f7da94dc319924020 100644 (file)
@@ -161,20 +161,8 @@ static struct pci_driver vt586b_driver = {
        .remove         = __devexit_p(vt586b_remove),
 };
 
-static int __init i2c_vt586b_init(void)
-{
-       return pci_register_driver(&vt586b_driver);
-}
-
-static void __exit i2c_vt586b_exit(void)
-{
-       pci_unregister_driver(&vt586b_driver);
-}
-
+module_pci_driver(vt586b_driver);
 
 MODULE_AUTHOR("Kyösti Mälkki <kmalkki@cc.hut.fi>");
 MODULE_DESCRIPTION("i2c for Via vt82c586b southbridge");
 MODULE_LICENSE("GPL");
-
-module_init(i2c_vt586b_init);
-module_exit(i2c_vt586b_exit);