Skip to content

Commit

Permalink
i2c/busses: Use module_platform_driver()
Browse files Browse the repository at this point in the history
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: Jochen Friedrich <jochen@scram.de>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Acked-by: Wolfram 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: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Axel Lin authored and Jean Delvare committed Jan 12, 2012
1 parent a699ed6 commit a3664b5
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 247 deletions.
17 changes: 2 additions & 15 deletions drivers/i2c/busses/i2c-at91.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,6 @@ static int at91_i2c_resume(struct platform_device *pdev)
#define at91_i2c_resume NULL
#endif

/* work with "modprobe at91_i2c" from hotplugging or coldplugging */
MODULE_ALIAS("platform:at91_i2c");

static struct platform_driver at91_i2c_driver = {
.probe = at91_i2c_probe,
.remove = __devexit_p(at91_i2c_remove),
Expand All @@ -309,19 +306,9 @@ static struct platform_driver at91_i2c_driver = {
},
};

static int __init at91_i2c_init(void)
{
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_platform_driver(at91_i2c_driver);

MODULE_AUTHOR("Rick Bronson");
MODULE_DESCRIPTION("I2C (TWI) driver for Atmel AT91");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:at91_i2c");
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-au1550.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,20 +426,9 @@ static struct platform_driver au1xpsc_smbus_driver = {
.remove = __devexit_p(i2c_au1550_remove),
};

static int __init i2c_au1550_init(void)
{
return platform_driver_register(&au1xpsc_smbus_driver);
}

static void __exit i2c_au1550_exit(void)
{
platform_driver_unregister(&au1xpsc_smbus_driver);
}
module_platform_driver(au1xpsc_smbus_driver);

MODULE_AUTHOR("Dan Malek, Embedded Edge, LLC.");
MODULE_DESCRIPTION("SMBus adapter Alchemy pb1550");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:au1xpsc_smbus");

module_init (i2c_au1550_init);
module_exit (i2c_au1550_exit);
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-cpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,18 +724,7 @@ static struct platform_driver cpm_i2c_driver = {
},
};

static int __init cpm_i2c_init(void)
{
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_platform_driver(cpm_i2c_driver);

MODULE_AUTHOR("Jochen Friedrich <jochen@scram.de>");
MODULE_DESCRIPTION("I2C-Bus adapter routines for CPM boards");
Expand Down
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-highlander.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,18 +468,7 @@ static struct platform_driver highlander_i2c_driver = {
.remove = __devexit_p(highlander_i2c_remove),
};

static int __init highlander_i2c_init(void)
{
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_platform_driver(highlander_i2c_driver);

MODULE_AUTHOR("Paul Mundt");
MODULE_DESCRIPTION("Renesas Highlander FPGA I2C/SMBus adapter");
Expand Down
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-ibm_iic.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,15 +815,4 @@ static struct platform_driver ibm_iic_driver = {
.remove = __devexit_p(iic_remove),
};

static int __init iic_init(void)
{
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);
module_platform_driver(ibm_iic_driver);
16 changes: 1 addition & 15 deletions drivers/i2c/busses/i2c-iop3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,21 +523,7 @@ static struct platform_driver iop3xx_i2c_driver = {
},
};

static int __init
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_platform_driver(iop3xx_i2c_driver);

MODULE_AUTHOR("D-TACQ Solutions Ltd <www.d-tacq.com>");
MODULE_DESCRIPTION("IOP3xx iic algorithm and driver");
Expand Down
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-isch.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,20 +306,9 @@ static struct platform_driver smbus_sch_driver = {
.remove = __devexit_p(smbus_sch_remove),
};

static int __init i2c_sch_init(void)
{
return platform_driver_register(&smbus_sch_driver);
}

static void __exit i2c_sch_exit(void)
{
platform_driver_unregister(&smbus_sch_driver);
}
module_platform_driver(smbus_sch_driver);

MODULE_AUTHOR("Jacob Pan <jacob.jun.pan@intel.com>");
MODULE_DESCRIPTION("Intel SCH SMBus driver");
MODULE_LICENSE("GPL");

module_init(i2c_sch_init);
module_exit(i2c_sch_exit);
MODULE_ALIAS("platform:isch_smbus");
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-ixp2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,18 +148,7 @@ static struct platform_driver ixp2000_i2c_driver = {
},
};

static int __init ixp2000_i2c_init(void)
{
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_platform_driver(ixp2000_i2c_driver);

MODULE_AUTHOR ("Deepak Saxena <dsaxena@plexity.net>");
MODULE_DESCRIPTION("IXP2000 GPIO-based I2C bus driver");
Expand Down
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-mpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -715,18 +715,7 @@ static struct platform_driver mpc_i2c_driver = {
},
};

static int __init fsl_i2c_init(void)
{
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_platform_driver(mpc_i2c_driver);

MODULE_AUTHOR("Adrian Cox <adrian@humboldt.co.uk>");
MODULE_DESCRIPTION("I2C-Bus adapter for MPC107 bridge and "
Expand Down
15 changes: 1 addition & 14 deletions drivers/i2c/busses/i2c-mv64xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,20 +611,7 @@ static struct platform_driver mv64xxx_i2c_driver = {
},
};

static int __init
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_platform_driver(mv64xxx_i2c_driver);

MODULE_AUTHOR("Mark A. Greer <mgreer@mvista.com>");
MODULE_DESCRIPTION("Marvell mv64xxx host bridge i2c ctlr driver");
Expand Down
17 changes: 2 additions & 15 deletions drivers/i2c/busses/i2c-ocores.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,9 +394,6 @@ static struct of_device_id 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 = {
.probe = ocores_i2c_probe,
.remove = __devexit_p(ocores_i2c_remove),
Expand All @@ -409,19 +406,9 @@ static struct platform_driver ocores_i2c_driver = {
},
};

static int __init ocores_i2c_init(void)
{
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_platform_driver(ocores_i2c_driver);

MODULE_AUTHOR("Peter Korsgaard <jacmet@sunsite.dk>");
MODULE_DESCRIPTION("OpenCores I2C bus driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:ocores-i2c");
16 changes: 1 addition & 15 deletions drivers/i2c/busses/i2c-octeon.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,24 +629,10 @@ static struct platform_driver octeon_i2c_driver = {
},
};

static int __init octeon_i2c_init(void)
{
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_platform_driver(octeon_i2c_driver);

MODULE_AUTHOR("Michael Lawnick <michael.lawnick.ext@nsn.com>");
MODULE_DESCRIPTION("I2C-Bus adapter for Cavium OCTEON processors");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);
MODULE_ALIAS("platform:" DRV_NAME);

module_init(octeon_i2c_init);
module_exit(octeon_i2c_exit);
14 changes: 1 addition & 13 deletions drivers/i2c/busses/i2c-pca-platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,20 +286,8 @@ static struct platform_driver i2c_pca_pf_driver = {
},
};

static int __init i2c_pca_pf_init(void)
{
return platform_driver_register(&i2c_pca_pf_driver);
}

static void __exit i2c_pca_pf_exit(void)
{
platform_driver_unregister(&i2c_pca_pf_driver);
}
module_platform_driver(i2c_pca_pf_driver);

MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>");
MODULE_DESCRIPTION("I2C-PCA9564/PCA9665 platform driver");
MODULE_LICENSE("GPL");

module_init(i2c_pca_pf_init);
module_exit(i2c_pca_pf_exit);

17 changes: 2 additions & 15 deletions drivers/i2c/busses/i2c-pmcmsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,6 @@ static struct i2c_adapter pmcmsptwi_adapter = {
.name = DRV_NAME,
};

/* work with hotplug and coldplug */
MODULE_ALIAS("platform:" DRV_NAME);

static struct platform_driver pmcmsptwi_driver = {
.probe = pmcmsptwi_probe,
.remove = __devexit_p(pmcmsptwi_remove),
Expand All @@ -639,18 +636,8 @@ static struct platform_driver pmcmsptwi_driver = {
},
};

static int __init pmcmsptwi_init(void)
{
return platform_driver_register(&pmcmsptwi_driver);
}

static void __exit pmcmsptwi_exit(void)
{
platform_driver_unregister(&pmcmsptwi_driver);
}
module_platform_driver(pmcmsptwi_driver);

MODULE_DESCRIPTION("PMC MSP TWI/SMBus/I2C driver");
MODULE_LICENSE("GPL");

module_init(pmcmsptwi_init);
module_exit(pmcmsptwi_exit);
MODULE_ALIAS("platform:" DRV_NAME);
19 changes: 2 additions & 17 deletions drivers/i2c/busses/i2c-powermac.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,6 @@ static int __devinit i2c_powermac_probe(struct platform_device *dev)
return rc;
}


/* work with hotplug and coldplug */
MODULE_ALIAS("platform:i2c-powermac");

static struct platform_driver i2c_powermac_driver = {
.probe = i2c_powermac_probe,
.remove = __devexit_p(i2c_powermac_remove),
Expand All @@ -325,17 +321,6 @@ static struct platform_driver i2c_powermac_driver = {
},
};

static int __init i2c_powermac_init(void)
{
platform_driver_register(&i2c_powermac_driver);
return 0;
}
module_platform_driver(i2c_powermac_driver);


static void __exit i2c_powermac_cleanup(void)
{
platform_driver_unregister(&i2c_powermac_driver);
}

module_init(i2c_powermac_init);
module_exit(i2c_powermac_cleanup);
MODULE_ALIAS("platform:i2c-powermac");
13 changes: 1 addition & 12 deletions drivers/i2c/busses/i2c-sh7760.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,7 @@ static struct platform_driver sh7760_i2c_drv = {
.remove = __devexit_p(sh7760_i2c_remove),
};

static int __init sh7760_i2c_init(void)
{
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_platform_driver(sh7760_i2c_drv);

MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("SH7760 I2C bus driver");
Expand Down
Loading

0 comments on commit a3664b5

Please sign in to comment.