提交 a3664b51 编写于 作者: A Axel Lin 提交者: Jean Delvare

i2c/busses: Use module_platform_driver()

Convert the drivers in drivers/i2c/busses/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Ben Dooks <ben-linux@fluff.org>
Acked-by: NJochen Friedrich <jochen@scram.de>
Acked-by: NPeter Korsgaard <jacmet@sunsite.dk>
Acked-by: NWolfram Sang <w.sang@pengutronix.de>
Cc: Manuel Lauss <manuel.lauss@googlemail.com>
Cc: Barry Song <21cnbao@gmail.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Yong Zhang <yong.zhang0@gmail.com>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: NAxel Lin <axel.lin@gmail.com>
Signed-off-by: NJean Delvare <khali@linux-fr.org>
上级 a699ed6f
...@@ -295,9 +295,6 @@ static int at91_i2c_resume(struct platform_device *pdev) ...@@ -295,9 +295,6 @@ static int at91_i2c_resume(struct platform_device *pdev)
#define at91_i2c_resume NULL #define at91_i2c_resume NULL
#endif #endif
/* work with "modprobe at91_i2c" from hotplugging or coldplugging */
MODULE_ALIAS("platform:at91_i2c");
static struct platform_driver at91_i2c_driver = { static struct platform_driver at91_i2c_driver = {
.probe = at91_i2c_probe, .probe = at91_i2c_probe,
.remove = __devexit_p(at91_i2c_remove), .remove = __devexit_p(at91_i2c_remove),
...@@ -309,19 +306,9 @@ static struct platform_driver at91_i2c_driver = { ...@@ -309,19 +306,9 @@ static struct platform_driver at91_i2c_driver = {
}, },
}; };
static int __init at91_i2c_init(void) module_platform_driver(at91_i2c_driver);
{
return platform_driver_register(&at91_i2c_driver);
}
static void __exit at91_i2c_exit(void)
{
platform_driver_unregister(&at91_i2c_driver);
}
module_init(at91_i2c_init);
module_exit(at91_i2c_exit);
MODULE_AUTHOR("Rick Bronson"); MODULE_AUTHOR("Rick Bronson");
MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91"); MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:at91_i2c");
...@@ -426,20 +426,9 @@ static struct platform_driver au1xpsc_smbus_driver = { ...@@ -426,20 +426,9 @@ static struct platform_driver au1xpsc_smbus_driver = {
.remove = __devexit_p(i2c_au1550_remove), .remove = __devexit_p(i2c_au1550_remove),
}; };
static int __init i2c_au1550_init(void) module_platform_driver(au1xpsc_smbus_driver);
{
return platform_driver_register(&au1xpsc_smbus_driver);
}
static void __exit i2c_au1550_exit(void)
{
platform_driver_unregister(&au1xpsc_smbus_driver);
}
MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC."); MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550"); MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:au1xpsc_smbus"); MODULE_ALIAS("platform:au1xpsc_smbus");
module_init (i2c_au1550_init);
module_exit (i2c_au1550_exit);
...@@ -724,18 +724,7 @@ static struct platform_driver cpm_i2c_driver = { ...@@ -724,18 +724,7 @@ static struct platform_driver cpm_i2c_driver = {
}, },
}; };
static int __init cpm_i2c_init(void) module_platform_driver(cpm_i2c_driver);
{
return platform_driver_register(&cpm_i2c_driver);
}
static void __exit cpm_i2c_exit(void)
{
platform_driver_unregister(&cpm_i2c_driver);
}
module_init(cpm_i2c_init);
module_exit(cpm_i2c_exit);
MODULE_AUTHOR("Jochen Friedrich <jochen@scram.de>"); MODULE_AUTHOR("Jochen Friedrich <jochen@scram.de>");
MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards"); MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards");
......
...@@ -468,18 +468,7 @@ static struct platform_driver highlander_i2c_driver = { ...@@ -468,18 +468,7 @@ static struct platform_driver highlander_i2c_driver = {
.remove = __devexit_p(highlander_i2c_remove), .remove = __devexit_p(highlander_i2c_remove),
}; };
static int __init highlander_i2c_init(void) module_platform_driver(highlander_i2c_driver);
{
return platform_driver_register(&highlander_i2c_driver);
}
static void __exit highlander_i2c_exit(void)
{
platform_driver_unregister(&highlander_i2c_driver);
}
module_init(highlander_i2c_init);
module_exit(highlander_i2c_exit);
MODULE_AUTHOR("Paul Mundt"); MODULE_AUTHOR("Paul Mundt");
MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter"); MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter");
......
...@@ -815,15 +815,4 @@ static struct platform_driver ibm_iic_driver = { ...@@ -815,15 +815,4 @@ static struct platform_driver ibm_iic_driver = {
.remove = __devexit_p(iic_remove), .remove = __devexit_p(iic_remove),
}; };
static int __init iic_init(void) module_platform_driver(ibm_iic_driver);
{
return platform_driver_register(&ibm_iic_driver);
}
static void __exit iic_exit(void)
{
platform_driver_unregister(&ibm_iic_driver);
}
module_init(iic_init);
module_exit(iic_exit);
...@@ -523,21 +523,7 @@ static struct platform_driver iop3xx_i2c_driver = { ...@@ -523,21 +523,7 @@ static struct platform_driver iop3xx_i2c_driver = {
}, },
}; };
static int __init module_platform_driver(iop3xx_i2c_driver);
i2c_iop3xx_init (void)
{
return platform_driver_register(&iop3xx_i2c_driver);
}
static void __exit
i2c_iop3xx_exit (void)
{
platform_driver_unregister(&iop3xx_i2c_driver);
return;
}
module_init (i2c_iop3xx_init);
module_exit (i2c_iop3xx_exit);
MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>"); MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>");
MODULE_DESCRIPTION("IOP3xx iic algorithm and driver"); MODULE_DESCRIPTION("IOP3xx iic algorithm and driver");
......
...@@ -306,20 +306,9 @@ static struct platform_driver smbus_sch_driver = { ...@@ -306,20 +306,9 @@ static struct platform_driver smbus_sch_driver = {
.remove = __devexit_p(smbus_sch_remove), .remove = __devexit_p(smbus_sch_remove),
}; };
static int __init i2c_sch_init(void) module_platform_driver(smbus_sch_driver);
{
return platform_driver_register(&smbus_sch_driver);
}
static void __exit i2c_sch_exit(void)
{
platform_driver_unregister(&smbus_sch_driver);
}
MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>"); MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>");
MODULE_DESCRIPTION("Intel SCH SMBus driver"); MODULE_DESCRIPTION("Intel SCH SMBus driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(i2c_sch_init);
module_exit(i2c_sch_exit);
MODULE_ALIAS("platform:isch_smbus"); MODULE_ALIAS("platform:isch_smbus");
...@@ -148,18 +148,7 @@ static struct platform_driver ixp2000_i2c_driver = { ...@@ -148,18 +148,7 @@ static struct platform_driver ixp2000_i2c_driver = {
}, },
}; };
static int __init ixp2000_i2c_init(void) module_platform_driver(ixp2000_i2c_driver);
{
return platform_driver_register(&ixp2000_i2c_driver);
}
static void __exit ixp2000_i2c_exit(void)
{
platform_driver_unregister(&ixp2000_i2c_driver);
}
module_init(ixp2000_i2c_init);
module_exit(ixp2000_i2c_exit);
MODULE_AUTHOR ("Deepak Saxena <dsaxena@plexity.net>"); MODULE_AUTHOR ("Deepak Saxena <dsaxena@plexity.net>");
MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver"); MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver");
......
...@@ -715,18 +715,7 @@ static struct platform_driver mpc_i2c_driver = { ...@@ -715,18 +715,7 @@ static struct platform_driver mpc_i2c_driver = {
}, },
}; };
static int __init fsl_i2c_init(void) module_platform_driver(mpc_i2c_driver);
{
return platform_driver_register(&mpc_i2c_driver);
}
static void __exit fsl_i2c_exit(void)
{
platform_driver_unregister(&mpc_i2c_driver);
}
module_init(fsl_i2c_init);
module_exit(fsl_i2c_exit);
MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>"); MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>");
MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and " MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and "
......
...@@ -611,20 +611,7 @@ static struct platform_driver mv64xxx_i2c_driver = { ...@@ -611,20 +611,7 @@ static struct platform_driver mv64xxx_i2c_driver = {
}, },
}; };
static int __init module_platform_driver(mv64xxx_i2c_driver);
mv64xxx_i2c_init(void)
{
return platform_driver_register(&mv64xxx_i2c_driver);
}
static void __exit
mv64xxx_i2c_exit(void)
{
platform_driver_unregister(&mv64xxx_i2c_driver);
}
module_init(mv64xxx_i2c_init);
module_exit(mv64xxx_i2c_exit);
MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>"); MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>");
MODULE_DESCRIPTION("Marvell mv64xxx host bridge i2c ctlr driver"); MODULE_DESCRIPTION("Marvell mv64xxx host bridge i2c ctlr driver");
......
...@@ -394,9 +394,6 @@ static struct of_device_id ocores_i2c_match[] = { ...@@ -394,9 +394,6 @@ static struct of_device_id ocores_i2c_match[] = {
}; };
MODULE_DEVICE_TABLE(of, ocores_i2c_match); MODULE_DEVICE_TABLE(of, ocores_i2c_match);
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:ocores-i2c");
static struct platform_driver ocores_i2c_driver = { static struct platform_driver ocores_i2c_driver = {
.probe = ocores_i2c_probe, .probe = ocores_i2c_probe,
.remove = __devexit_p(ocores_i2c_remove), .remove = __devexit_p(ocores_i2c_remove),
...@@ -409,19 +406,9 @@ static struct platform_driver ocores_i2c_driver = { ...@@ -409,19 +406,9 @@ static struct platform_driver ocores_i2c_driver = {
}, },
}; };
static int __init ocores_i2c_init(void) module_platform_driver(ocores_i2c_driver);
{
return platform_driver_register(&ocores_i2c_driver);
}
static void __exit ocores_i2c_exit(void)
{
platform_driver_unregister(&ocores_i2c_driver);
}
module_init(ocores_i2c_init);
module_exit(ocores_i2c_exit);
MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>"); MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
MODULE_DESCRIPTION("OpenCores I2C bus driver"); MODULE_DESCRIPTION("OpenCores I2C bus driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:ocores-i2c");
...@@ -629,24 +629,10 @@ static struct platform_driver octeon_i2c_driver = { ...@@ -629,24 +629,10 @@ static struct platform_driver octeon_i2c_driver = {
}, },
}; };
static int __init octeon_i2c_init(void) module_platform_driver(octeon_i2c_driver);
{
int rv;
rv = platform_driver_register(&octeon_i2c_driver);
return rv;
}
static void __exit octeon_i2c_exit(void)
{
platform_driver_unregister(&octeon_i2c_driver);
}
MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>"); MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>");
MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors"); MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
MODULE_ALIAS("platform:" DRV_NAME); MODULE_ALIAS("platform:" DRV_NAME);
module_init(octeon_i2c_init);
module_exit(octeon_i2c_exit);
...@@ -286,20 +286,8 @@ static struct platform_driver i2c_pca_pf_driver = { ...@@ -286,20 +286,8 @@ static struct platform_driver i2c_pca_pf_driver = {
}, },
}; };
static int __init i2c_pca_pf_init(void) module_platform_driver(i2c_pca_pf_driver);
{
return platform_driver_register(&i2c_pca_pf_driver);
}
static void __exit i2c_pca_pf_exit(void)
{
platform_driver_unregister(&i2c_pca_pf_driver);
}
MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>"); MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>");
MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver"); MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
module_init(i2c_pca_pf_init);
module_exit(i2c_pca_pf_exit);
...@@ -627,9 +627,6 @@ static struct i2c_adapter pmcmsptwi_adapter = { ...@@ -627,9 +627,6 @@ static struct i2c_adapter pmcmsptwi_adapter = {
.name = DRV_NAME, .name = DRV_NAME,
}; };
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:" DRV_NAME);
static struct platform_driver pmcmsptwi_driver = { static struct platform_driver pmcmsptwi_driver = {
.probe = pmcmsptwi_probe, .probe = pmcmsptwi_probe,
.remove = __devexit_p(pmcmsptwi_remove), .remove = __devexit_p(pmcmsptwi_remove),
...@@ -639,18 +636,8 @@ static struct platform_driver pmcmsptwi_driver = { ...@@ -639,18 +636,8 @@ static struct platform_driver pmcmsptwi_driver = {
}, },
}; };
static int __init pmcmsptwi_init(void) module_platform_driver(pmcmsptwi_driver);
{
return platform_driver_register(&pmcmsptwi_driver);
}
static void __exit pmcmsptwi_exit(void)
{
platform_driver_unregister(&pmcmsptwi_driver);
}
MODULE_DESCRIPTION("PMC MSP TWI/SMBus/I2C driver"); MODULE_DESCRIPTION("PMC MSP TWI/SMBus/I2C driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRV_NAME);
module_init(pmcmsptwi_init);
module_exit(pmcmsptwi_exit);
...@@ -312,10 +312,6 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev) ...@@ -312,10 +312,6 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev)
return rc; return rc;
} }
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:i2c-powermac");
static struct platform_driver i2c_powermac_driver = { static struct platform_driver i2c_powermac_driver = {
.probe = i2c_powermac_probe, .probe = i2c_powermac_probe,
.remove = __devexit_p(i2c_powermac_remove), .remove = __devexit_p(i2c_powermac_remove),
...@@ -325,17 +321,6 @@ static struct platform_driver i2c_powermac_driver = { ...@@ -325,17 +321,6 @@ static struct platform_driver i2c_powermac_driver = {
}, },
}; };
static int __init i2c_powermac_init(void) module_platform_driver(i2c_powermac_driver);
{
platform_driver_register(&i2c_powermac_driver);
return 0;
}
MODULE_ALIAS("platform:i2c-powermac");
static void __exit i2c_powermac_cleanup(void)
{
platform_driver_unregister(&i2c_powermac_driver);
}
module_init(i2c_powermac_init);
module_exit(i2c_powermac_cleanup);
...@@ -560,18 +560,7 @@ static struct platform_driver sh7760_i2c_drv = { ...@@ -560,18 +560,7 @@ static struct platform_driver sh7760_i2c_drv = {
.remove = __devexit_p(sh7760_i2c_remove), .remove = __devexit_p(sh7760_i2c_remove),
}; };
static int __init sh7760_i2c_init(void) module_platform_driver(sh7760_i2c_drv);
{
return platform_driver_register(&sh7760_i2c_drv);
}
static void __exit sh7760_i2c_exit(void)
{
platform_driver_unregister(&sh7760_i2c_drv);
}
module_init(sh7760_i2c_init);
module_exit(sh7760_i2c_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SH7760 I2C bus driver"); MODULE_DESCRIPTION("SH7760 I2C bus driver");
......
...@@ -156,12 +156,8 @@ static int simtec_i2c_remove(struct platform_device *dev) ...@@ -156,12 +156,8 @@ static int simtec_i2c_remove(struct platform_device *dev)
return 0; return 0;
} }
/* device driver */ /* device driver */
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:simtec-i2c");
static struct platform_driver simtec_i2c_driver = { static struct platform_driver simtec_i2c_driver = {
.driver = { .driver = {
.name = "simtec-i2c", .name = "simtec-i2c",
...@@ -171,19 +167,9 @@ static struct platform_driver simtec_i2c_driver = { ...@@ -171,19 +167,9 @@ static struct platform_driver simtec_i2c_driver = {
.remove = simtec_i2c_remove, .remove = simtec_i2c_remove,
}; };
static int __init i2c_adap_simtec_init(void) module_platform_driver(simtec_i2c_driver);
{
return platform_driver_register(&simtec_i2c_driver);
}
static void __exit i2c_adap_simtec_exit(void)
{
platform_driver_unregister(&simtec_i2c_driver);
}
module_init(i2c_adap_simtec_init);
module_exit(i2c_adap_simtec_exit);
MODULE_DESCRIPTION("Simtec Generic I2C Bus driver"); MODULE_DESCRIPTION("Simtec Generic I2C Bus driver");
MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:simtec-i2c");
...@@ -795,10 +795,6 @@ static int __devexit xiic_i2c_remove(struct platform_device* pdev) ...@@ -795,10 +795,6 @@ static int __devexit xiic_i2c_remove(struct platform_device* pdev)
return 0; return 0;
} }
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:"DRIVER_NAME);
static struct platform_driver xiic_i2c_driver = { static struct platform_driver xiic_i2c_driver = {
.probe = xiic_i2c_probe, .probe = xiic_i2c_probe,
.remove = __devexit_p(xiic_i2c_remove), .remove = __devexit_p(xiic_i2c_remove),
...@@ -808,19 +804,9 @@ static struct platform_driver xiic_i2c_driver = { ...@@ -808,19 +804,9 @@ static struct platform_driver xiic_i2c_driver = {
}, },
}; };
static int __init xiic_i2c_init(void) module_platform_driver(xiic_i2c_driver);
{
return platform_driver_register(&xiic_i2c_driver);
}
static void __exit xiic_i2c_exit(void)
{
platform_driver_unregister(&xiic_i2c_driver);
}
module_init(xiic_i2c_init);
module_exit(xiic_i2c_exit);
MODULE_AUTHOR("info@mocean-labs.com"); MODULE_AUTHOR("info@mocean-labs.com");
MODULE_DESCRIPTION("Xilinx I2C bus driver"); MODULE_DESCRIPTION("Xilinx I2C bus driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_ALIAS("platform:"DRIVER_NAME);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册