aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-s3c24xx.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2011-10-05 13:29:49 -0400
committerGrant Likely <grant.likely@secretlab.ca>2011-10-24 18:35:47 -0400
commit940ab88962bc1aff3273a8356d64577a6e386736 (patch)
tree3d96d0cb30fd3c6e1b17b2a2d264f4d44258a3bb /drivers/spi/spi-s3c24xx.c
parent38ada214fad79ff5ebbed58932c5f0c9969d9c91 (diff)
drivercore: Add helper macro for platform_driver boilerplate
For simple modules that contain a single platform_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_platform_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Reviewed-by: Magnus Damm <magnus.damm@gmail.com> Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'drivers/spi/spi-s3c24xx.c')
-rw-r--r--drivers/spi/spi-s3c24xx.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
index 1996ac57ef91..b857a3e7af94 100644
--- a/drivers/spi/spi-s3c24xx.c
+++ b/drivers/spi/spi-s3c24xx.c
@@ -505,7 +505,7 @@ static void s3c24xx_spi_initialsetup(struct s3c24xx_spi *hw)
505 } 505 }
506} 506}
507 507
508static int __init s3c24xx_spi_probe(struct platform_device *pdev) 508static int __devinit s3c24xx_spi_probe(struct platform_device *pdev)
509{ 509{
510 struct s3c2410_spi_info *pdata; 510 struct s3c2410_spi_info *pdata;
511 struct s3c24xx_spi *hw; 511 struct s3c24xx_spi *hw;
@@ -661,7 +661,7 @@ static int __init s3c24xx_spi_probe(struct platform_device *pdev)
661 return err; 661 return err;
662} 662}
663 663
664static int __exit s3c24xx_spi_remove(struct platform_device *dev) 664static int __devexit s3c24xx_spi_remove(struct platform_device *dev)
665{ 665{
666 struct s3c24xx_spi *hw = platform_get_drvdata(dev); 666 struct s3c24xx_spi *hw = platform_get_drvdata(dev);
667 667
@@ -719,26 +719,15 @@ static const struct dev_pm_ops s3c24xx_spi_pmops = {
719 719
720MODULE_ALIAS("platform:s3c2410-spi"); 720MODULE_ALIAS("platform:s3c2410-spi");
721static struct platform_driver s3c24xx_spi_driver = { 721static struct platform_driver s3c24xx_spi_driver = {
722 .remove = __exit_p(s3c24xx_spi_remove), 722 .probe = s3c24xx_spi_probe,
723 .remove = __devexit_p(s3c24xx_spi_remove),
723 .driver = { 724 .driver = {
724 .name = "s3c2410-spi", 725 .name = "s3c2410-spi",
725 .owner = THIS_MODULE, 726 .owner = THIS_MODULE,
726 .pm = S3C24XX_SPI_PMOPS, 727 .pm = S3C24XX_SPI_PMOPS,
727 }, 728 },
728}; 729};
729 730module_platform_driver(s3c24xx_spi_driver);
730static int __init s3c24xx_spi_init(void)
731{
732 return platform_driver_probe(&s3c24xx_spi_driver, s3c24xx_spi_probe);
733}
734
735static void __exit s3c24xx_spi_exit(void)
736{
737 platform_driver_unregister(&s3c24xx_spi_driver);
738}
739
740module_init(s3c24xx_spi_init);
741module_exit(s3c24xx_spi_exit);
742 731
743MODULE_DESCRIPTION("S3C24XX SPI Driver"); 732MODULE_DESCRIPTION("S3C24XX SPI Driver");
744MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); 733MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");