aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
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
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')
-rw-r--r--drivers/spi/spi-altera.c13
-rw-r--r--drivers/spi/spi-ath79.c13
-rw-r--r--drivers/spi/spi-atmel.c13
-rw-r--r--drivers/spi/spi-bfin-sport.c13
-rw-r--r--drivers/spi/spi-coldfire-qspi.c14
-rw-r--r--drivers/spi/spi-davinci.c20
-rw-r--r--drivers/spi/spi-dw-mmio.c14
-rw-r--r--drivers/spi/spi-ep93xx.c20
-rw-r--r--drivers/spi/spi-fsl-espi.c13
-rw-r--r--drivers/spi/spi-gpio.c21
-rw-r--r--drivers/spi/spi-imx.c14
-rw-r--r--drivers/spi/spi-mpc512x-psc.c13
-rw-r--r--drivers/spi/spi-mpc52xx-psc.c13
-rw-r--r--drivers/spi/spi-mpc52xx.c14
-rw-r--r--drivers/spi/spi-nuc900.c14
-rw-r--r--drivers/spi/spi-oc-tiny.c13
-rw-r--r--drivers/spi/spi-ppc4xx.c13
-rw-r--r--drivers/spi/spi-s3c24xx.c21
-rw-r--r--drivers/spi/spi-sh-msiof.c13
-rw-r--r--drivers/spi/spi-sh-sci.c13
-rw-r--r--drivers/spi/spi-sh.c13
-rw-r--r--drivers/spi/spi-stmp.c13
-rw-r--r--drivers/spi/spi-tegra.c16
-rw-r--r--drivers/spi/spi-ti-ssp.c13
-rw-r--r--drivers/spi/spi-xilinx.c13
25 files changed, 45 insertions, 318 deletions
diff --git a/drivers/spi/spi-altera.c b/drivers/spi/spi-altera.c
index 4813a63ce6fb..881c1967741d 100644
--- a/drivers/spi/spi-altera.c
+++ b/drivers/spi/spi-altera.c
@@ -320,18 +320,7 @@ static struct platform_driver altera_spi_driver = {
320 .of_match_table = altera_spi_match, 320 .of_match_table = altera_spi_match,
321 }, 321 },
322}; 322};
323 323module_platform_driver(altera_spi_driver);
324static int __init altera_spi_init(void)
325{
326 return platform_driver_register(&altera_spi_driver);
327}
328module_init(altera_spi_init);
329
330static void __exit altera_spi_exit(void)
331{
332 platform_driver_unregister(&altera_spi_driver);
333}
334module_exit(altera_spi_exit);
335 324
336MODULE_DESCRIPTION("Altera SPI driver"); 325MODULE_DESCRIPTION("Altera SPI driver");
337MODULE_AUTHOR("Thomas Chou <thomas@wytron.com.tw>"); 326MODULE_AUTHOR("Thomas Chou <thomas@wytron.com.tw>");
diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c
index 03019bf5a5e9..024b48aed5ca 100644
--- a/drivers/spi/spi-ath79.c
+++ b/drivers/spi/spi-ath79.c
@@ -273,18 +273,7 @@ static struct platform_driver ath79_spi_driver = {
273 .owner = THIS_MODULE, 273 .owner = THIS_MODULE,
274 }, 274 },
275}; 275};
276 276module_platform_driver(ath79_spi_driver);
277static __init int ath79_spi_init(void)
278{
279 return platform_driver_register(&ath79_spi_driver);
280}
281module_init(ath79_spi_init);
282
283static __exit void ath79_spi_exit(void)
284{
285 platform_driver_unregister(&ath79_spi_driver);
286}
287module_exit(ath79_spi_exit);
288 277
289MODULE_DESCRIPTION("SPI controller driver for Atheros AR71XX/AR724X/AR913X"); 278MODULE_DESCRIPTION("SPI controller driver for Atheros AR71XX/AR724X/AR913X");
290MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>"); 279MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>");
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 82dee9a6c0de..a356392ab2f6 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1074,18 +1074,7 @@ static struct platform_driver atmel_spi_driver = {
1074 .resume = atmel_spi_resume, 1074 .resume = atmel_spi_resume,
1075 .remove = __exit_p(atmel_spi_remove), 1075 .remove = __exit_p(atmel_spi_remove),
1076}; 1076};
1077 1077module_platform_driver(atmel_spi_driver);
1078static int __init atmel_spi_init(void)
1079{
1080 return platform_driver_probe(&atmel_spi_driver, atmel_spi_probe);
1081}
1082module_init(atmel_spi_init);
1083
1084static void __exit atmel_spi_exit(void)
1085{
1086 platform_driver_unregister(&atmel_spi_driver);
1087}
1088module_exit(atmel_spi_exit);
1089 1078
1090MODULE_DESCRIPTION("Atmel AT32/AT91 SPI Controller driver"); 1079MODULE_DESCRIPTION("Atmel AT32/AT91 SPI Controller driver");
1091MODULE_AUTHOR("Haavard Skinnemoen (Atmel)"); 1080MODULE_AUTHOR("Haavard Skinnemoen (Atmel)");
diff --git a/drivers/spi/spi-bfin-sport.c b/drivers/spi/spi-bfin-sport.c
index e557ff617b11..248a2cc671a9 100644
--- a/drivers/spi/spi-bfin-sport.c
+++ b/drivers/spi/spi-bfin-sport.c
@@ -938,15 +938,4 @@ static struct platform_driver bfin_sport_spi_driver = {
938 .suspend = bfin_sport_spi_suspend, 938 .suspend = bfin_sport_spi_suspend,
939 .resume = bfin_sport_spi_resume, 939 .resume = bfin_sport_spi_resume,
940}; 940};
941 941module_platform_driver(bfin_sport_spi_driver);
942static int __init bfin_sport_spi_init(void)
943{
944 return platform_driver_register(&bfin_sport_spi_driver);
945}
946module_init(bfin_sport_spi_init);
947
948static void __exit bfin_sport_spi_exit(void)
949{
950 platform_driver_unregister(&bfin_sport_spi_driver);
951}
952module_exit(bfin_sport_spi_exit);
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index 7397c4d57007..6eee64a5d240 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -621,20 +621,10 @@ static struct platform_driver mcfqspi_driver = {
621 .driver.name = DRIVER_NAME, 621 .driver.name = DRIVER_NAME,
622 .driver.owner = THIS_MODULE, 622 .driver.owner = THIS_MODULE,
623 .driver.pm = MCFQSPI_DEV_PM_OPS, 623 .driver.pm = MCFQSPI_DEV_PM_OPS,
624 .probe = mcfqspi_probe,
624 .remove = __devexit_p(mcfqspi_remove), 625 .remove = __devexit_p(mcfqspi_remove),
625}; 626};
626 627module_platform_driver(mcfqspi_driver);
627static int __init mcfqspi_init(void)
628{
629 return platform_driver_probe(&mcfqspi_driver, mcfqspi_probe);
630}
631module_init(mcfqspi_init);
632
633static void __exit mcfqspi_exit(void)
634{
635 platform_driver_unregister(&mcfqspi_driver);
636}
637module_exit(mcfqspi_exit);
638 628
639MODULE_AUTHOR("Steven King <sfking@fdwdc.com>"); 629MODULE_AUTHOR("Steven King <sfking@fdwdc.com>");
640MODULE_DESCRIPTION("Coldfire QSPI Controller Driver"); 630MODULE_DESCRIPTION("Coldfire QSPI Controller Driver");
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 1f0ed8005c91..31bfba805cf4 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -799,7 +799,7 @@ rx_dma_failed:
799 * It will invoke spi_bitbang_start to create work queue so that client driver 799 * It will invoke spi_bitbang_start to create work queue so that client driver
800 * can register transfer method to work queue. 800 * can register transfer method to work queue.
801 */ 801 */
802static int davinci_spi_probe(struct platform_device *pdev) 802static int __devinit davinci_spi_probe(struct platform_device *pdev)
803{ 803{
804 struct spi_master *master; 804 struct spi_master *master;
805 struct davinci_spi *dspi; 805 struct davinci_spi *dspi;
@@ -984,7 +984,7 @@ err:
984 * It will also call spi_bitbang_stop to destroy the work queue which was 984 * It will also call spi_bitbang_stop to destroy the work queue which was
985 * created by spi_bitbang_start. 985 * created by spi_bitbang_start.
986 */ 986 */
987static int __exit davinci_spi_remove(struct platform_device *pdev) 987static int __devexit davinci_spi_remove(struct platform_device *pdev)
988{ 988{
989 struct davinci_spi *dspi; 989 struct davinci_spi *dspi;
990 struct spi_master *master; 990 struct spi_master *master;
@@ -1011,20 +1011,10 @@ static struct platform_driver davinci_spi_driver = {
1011 .name = "spi_davinci", 1011 .name = "spi_davinci",
1012 .owner = THIS_MODULE, 1012 .owner = THIS_MODULE,
1013 }, 1013 },
1014 .remove = __exit_p(davinci_spi_remove), 1014 .probe = davinci_spi_probe,
1015 .remove = __devexit_p(davinci_spi_remove),
1015}; 1016};
1016 1017module_platform_driver(davinci_spi_driver);
1017static int __init davinci_spi_init(void)
1018{
1019 return platform_driver_probe(&davinci_spi_driver, davinci_spi_probe);
1020}
1021module_init(davinci_spi_init);
1022
1023static void __exit davinci_spi_exit(void)
1024{
1025 platform_driver_unregister(&davinci_spi_driver);
1026}
1027module_exit(davinci_spi_exit);
1028 1018
1029MODULE_DESCRIPTION("TI DaVinci SPI Master Controller Driver"); 1019MODULE_DESCRIPTION("TI DaVinci SPI Master Controller Driver");
1030MODULE_LICENSE("GPL"); 1020MODULE_LICENSE("GPL");
diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c
index 34eb66501dbf..fac399c3022c 100644
--- a/drivers/spi/spi-dw-mmio.c
+++ b/drivers/spi/spi-dw-mmio.c
@@ -127,24 +127,14 @@ static int __devexit dw_spi_mmio_remove(struct platform_device *pdev)
127} 127}
128 128
129static struct platform_driver dw_spi_mmio_driver = { 129static struct platform_driver dw_spi_mmio_driver = {
130 .probe = dw_spi_mmio_probe,
130 .remove = __devexit_p(dw_spi_mmio_remove), 131 .remove = __devexit_p(dw_spi_mmio_remove),
131 .driver = { 132 .driver = {
132 .name = DRIVER_NAME, 133 .name = DRIVER_NAME,
133 .owner = THIS_MODULE, 134 .owner = THIS_MODULE,
134 }, 135 },
135}; 136};
136 137module_platform_driver(dw_spi_mmio_driver);
137static int __init dw_spi_mmio_init(void)
138{
139 return platform_driver_probe(&dw_spi_mmio_driver, dw_spi_mmio_probe);
140}
141module_init(dw_spi_mmio_init);
142
143static void __exit dw_spi_mmio_exit(void)
144{
145 platform_driver_unregister(&dw_spi_mmio_driver);
146}
147module_exit(dw_spi_mmio_exit);
148 138
149MODULE_AUTHOR("Jean-Hugues Deschenes <jean-hugues.deschenes@octasic.com>"); 139MODULE_AUTHOR("Jean-Hugues Deschenes <jean-hugues.deschenes@octasic.com>");
150MODULE_DESCRIPTION("Memory-mapped I/O interface driver for DW SPI Core"); 140MODULE_DESCRIPTION("Memory-mapped I/O interface driver for DW SPI Core");
diff --git a/drivers/spi/spi-ep93xx.c b/drivers/spi/spi-ep93xx.c
index 11515c5531df..0a282e5fcc9c 100644
--- a/drivers/spi/spi-ep93xx.c
+++ b/drivers/spi/spi-ep93xx.c
@@ -1026,7 +1026,7 @@ static void ep93xx_spi_release_dma(struct ep93xx_spi *espi)
1026 free_page((unsigned long)espi->zeropage); 1026 free_page((unsigned long)espi->zeropage);
1027} 1027}
1028 1028
1029static int __init ep93xx_spi_probe(struct platform_device *pdev) 1029static int __devinit ep93xx_spi_probe(struct platform_device *pdev)
1030{ 1030{
1031 struct spi_master *master; 1031 struct spi_master *master;
1032 struct ep93xx_spi_info *info; 1032 struct ep93xx_spi_info *info;
@@ -1151,7 +1151,7 @@ fail_release_master:
1151 return error; 1151 return error;
1152} 1152}
1153 1153
1154static int __exit ep93xx_spi_remove(struct platform_device *pdev) 1154static int __devexit ep93xx_spi_remove(struct platform_device *pdev)
1155{ 1155{
1156 struct spi_master *master = platform_get_drvdata(pdev); 1156 struct spi_master *master = platform_get_drvdata(pdev);
1157 struct ep93xx_spi *espi = spi_master_get_devdata(master); 1157 struct ep93xx_spi *espi = spi_master_get_devdata(master);
@@ -1197,20 +1197,10 @@ static struct platform_driver ep93xx_spi_driver = {
1197 .name = "ep93xx-spi", 1197 .name = "ep93xx-spi",
1198 .owner = THIS_MODULE, 1198 .owner = THIS_MODULE,
1199 }, 1199 },
1200 .remove = __exit_p(ep93xx_spi_remove), 1200 .probe = ep93xx_spi_probe,
1201 .remove = __devexit_p(ep93xx_spi_remove),
1201}; 1202};
1202 1203module_platform_driver(ep93xx_spi_driver);
1203static int __init ep93xx_spi_init(void)
1204{
1205 return platform_driver_probe(&ep93xx_spi_driver, ep93xx_spi_probe);
1206}
1207module_init(ep93xx_spi_init);
1208
1209static void __exit ep93xx_spi_exit(void)
1210{
1211 platform_driver_unregister(&ep93xx_spi_driver);
1212}
1213module_exit(ep93xx_spi_exit);
1214 1204
1215MODULE_DESCRIPTION("EP93xx SPI Controller driver"); 1205MODULE_DESCRIPTION("EP93xx SPI Controller driver");
1216MODULE_AUTHOR("Mika Westerberg <mika.westerberg@iki.fi>"); 1206MODULE_AUTHOR("Mika Westerberg <mika.westerberg@iki.fi>");
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index 54e499d5f92c..d770f03705c3 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -744,18 +744,7 @@ static struct platform_driver fsl_espi_driver = {
744 .probe = of_fsl_espi_probe, 744 .probe = of_fsl_espi_probe,
745 .remove = __devexit_p(of_fsl_espi_remove), 745 .remove = __devexit_p(of_fsl_espi_remove),
746}; 746};
747 747module_platform_driver(fsl_espi_driver);
748static int __init fsl_espi_init(void)
749{
750 return platform_driver_register(&fsl_espi_driver);
751}
752module_init(fsl_espi_init);
753
754static void __exit fsl_espi_exit(void)
755{
756 platform_driver_unregister(&fsl_espi_driver);
757}
758module_exit(fsl_espi_exit);
759 748
760MODULE_AUTHOR("Mingkai Hu"); 749MODULE_AUTHOR("Mingkai Hu");
761MODULE_DESCRIPTION("Enhanced Freescale SPI Driver"); 750MODULE_DESCRIPTION("Enhanced Freescale SPI Driver");
diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c
index 0e88ab745490..635ff08b377f 100644
--- a/drivers/spi/spi-gpio.c
+++ b/drivers/spi/spi-gpio.c
@@ -311,7 +311,7 @@ done:
311 return value; 311 return value;
312} 312}
313 313
314static int __init spi_gpio_probe(struct platform_device *pdev) 314static int __devinit spi_gpio_probe(struct platform_device *pdev)
315{ 315{
316 int status; 316 int status;
317 struct spi_master *master; 317 struct spi_master *master;
@@ -379,7 +379,7 @@ gpio_free:
379 return status; 379 return status;
380} 380}
381 381
382static int __exit spi_gpio_remove(struct platform_device *pdev) 382static int __devexit spi_gpio_remove(struct platform_device *pdev)
383{ 383{
384 struct spi_gpio *spi_gpio; 384 struct spi_gpio *spi_gpio;
385 struct spi_gpio_platform_data *pdata; 385 struct spi_gpio_platform_data *pdata;
@@ -408,21 +408,10 @@ MODULE_ALIAS("platform:" DRIVER_NAME);
408static struct platform_driver spi_gpio_driver = { 408static struct platform_driver spi_gpio_driver = {
409 .driver.name = DRIVER_NAME, 409 .driver.name = DRIVER_NAME,
410 .driver.owner = THIS_MODULE, 410 .driver.owner = THIS_MODULE,
411 .remove = __exit_p(spi_gpio_remove), 411 .probe = spi_gpio_probe,
412 .remove = __devexit_p(spi_gpio_remove),
412}; 413};
413 414module_platform_driver(spi_gpio_driver);
414static int __init spi_gpio_init(void)
415{
416 return platform_driver_probe(&spi_gpio_driver, spi_gpio_probe);
417}
418module_init(spi_gpio_init);
419
420static void __exit spi_gpio_exit(void)
421{
422 platform_driver_unregister(&spi_gpio_driver);
423}
424module_exit(spi_gpio_exit);
425
426 415
427MODULE_DESCRIPTION("SPI master driver using generic bitbanged GPIO "); 416MODULE_DESCRIPTION("SPI master driver using generic bitbanged GPIO ");
428MODULE_AUTHOR("David Brownell"); 417MODULE_AUTHOR("David Brownell");
diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c
index fa594d604aca..c6e697f5e007 100644
--- a/drivers/spi/spi-imx.c
+++ b/drivers/spi/spi-imx.c
@@ -929,19 +929,7 @@ static struct platform_driver spi_imx_driver = {
929 .probe = spi_imx_probe, 929 .probe = spi_imx_probe,
930 .remove = __devexit_p(spi_imx_remove), 930 .remove = __devexit_p(spi_imx_remove),
931}; 931};
932 932module_platform_driver(spi_imx_driver);
933static int __init spi_imx_init(void)
934{
935 return platform_driver_register(&spi_imx_driver);
936}
937
938static void __exit spi_imx_exit(void)
939{
940 platform_driver_unregister(&spi_imx_driver);
941}
942
943module_init(spi_imx_init);
944module_exit(spi_imx_exit);
945 933
946MODULE_DESCRIPTION("SPI Master Controller driver"); 934MODULE_DESCRIPTION("SPI Master Controller driver");
947MODULE_AUTHOR("Sascha Hauer, Pengutronix"); 935MODULE_AUTHOR("Sascha Hauer, Pengutronix");
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
index 6a5b4238fb6b..4c63f772780a 100644
--- a/drivers/spi/spi-mpc512x-psc.c
+++ b/drivers/spi/spi-mpc512x-psc.c
@@ -559,18 +559,7 @@ static struct platform_driver mpc512x_psc_spi_of_driver = {
559 .of_match_table = mpc512x_psc_spi_of_match, 559 .of_match_table = mpc512x_psc_spi_of_match,
560 }, 560 },
561}; 561};
562 562module_platform_driver(mpc512x_psc_spi_of_driver);
563static int __init mpc512x_psc_spi_init(void)
564{
565 return platform_driver_register(&mpc512x_psc_spi_of_driver);
566}
567module_init(mpc512x_psc_spi_init);
568
569static void __exit mpc512x_psc_spi_exit(void)
570{
571 platform_driver_unregister(&mpc512x_psc_spi_of_driver);
572}
573module_exit(mpc512x_psc_spi_exit);
574 563
575MODULE_AUTHOR("John Rigby"); 564MODULE_AUTHOR("John Rigby");
576MODULE_DESCRIPTION("MPC512x PSC SPI Driver"); 565MODULE_DESCRIPTION("MPC512x PSC SPI Driver");
diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c
index e30baf0852ac..66047156d90d 100644
--- a/drivers/spi/spi-mpc52xx-psc.c
+++ b/drivers/spi/spi-mpc52xx-psc.c
@@ -511,18 +511,7 @@ static struct platform_driver mpc52xx_psc_spi_of_driver = {
511 .of_match_table = mpc52xx_psc_spi_of_match, 511 .of_match_table = mpc52xx_psc_spi_of_match,
512 }, 512 },
513}; 513};
514 514module_platform_driver(mpc52xx_psc_spi_of_driver);
515static int __init mpc52xx_psc_spi_init(void)
516{
517 return platform_driver_register(&mpc52xx_psc_spi_of_driver);
518}
519module_init(mpc52xx_psc_spi_init);
520
521static void __exit mpc52xx_psc_spi_exit(void)
522{
523 platform_driver_unregister(&mpc52xx_psc_spi_of_driver);
524}
525module_exit(mpc52xx_psc_spi_exit);
526 515
527MODULE_AUTHOR("Dragos Carp"); 516MODULE_AUTHOR("Dragos Carp");
528MODULE_DESCRIPTION("MPC52xx PSC SPI Driver"); 517MODULE_DESCRIPTION("MPC52xx PSC SPI Driver");
diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c
index 015a974bed72..57633d963456 100644
--- a/drivers/spi/spi-mpc52xx.c
+++ b/drivers/spi/spi-mpc52xx.c
@@ -564,16 +564,4 @@ static struct platform_driver mpc52xx_spi_of_driver = {
564 .probe = mpc52xx_spi_probe, 564 .probe = mpc52xx_spi_probe,
565 .remove = __devexit_p(mpc52xx_spi_remove), 565 .remove = __devexit_p(mpc52xx_spi_remove),
566}; 566};
567 567module_platform_driver(mpc52xx_spi_of_driver);
568static int __init mpc52xx_spi_init(void)
569{
570 return platform_driver_register(&mpc52xx_spi_of_driver);
571}
572module_init(mpc52xx_spi_init);
573
574static void __exit mpc52xx_spi_exit(void)
575{
576 platform_driver_unregister(&mpc52xx_spi_of_driver);
577}
578module_exit(mpc52xx_spi_exit);
579
diff --git a/drivers/spi/spi-nuc900.c b/drivers/spi/spi-nuc900.c
index c0a6ce81f9c0..e763254741c2 100644
--- a/drivers/spi/spi-nuc900.c
+++ b/drivers/spi/spi-nuc900.c
@@ -484,19 +484,7 @@ static struct platform_driver nuc900_spi_driver = {
484 .owner = THIS_MODULE, 484 .owner = THIS_MODULE,
485 }, 485 },
486}; 486};
487 487module_platform_driver(nuc900_spi_driver);
488static int __init nuc900_spi_init(void)
489{
490 return platform_driver_register(&nuc900_spi_driver);
491}
492
493static void __exit nuc900_spi_exit(void)
494{
495 platform_driver_unregister(&nuc900_spi_driver);
496}
497
498module_init(nuc900_spi_init);
499module_exit(nuc900_spi_exit);
500 488
501MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>"); 489MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
502MODULE_DESCRIPTION("nuc900 spi driver!"); 490MODULE_DESCRIPTION("nuc900 spi driver!");
diff --git a/drivers/spi/spi-oc-tiny.c b/drivers/spi/spi-oc-tiny.c
index f1bde66cea19..897274e8715c 100644
--- a/drivers/spi/spi-oc-tiny.c
+++ b/drivers/spi/spi-oc-tiny.c
@@ -406,18 +406,7 @@ static struct platform_driver tiny_spi_driver = {
406 .of_match_table = tiny_spi_match, 406 .of_match_table = tiny_spi_match,
407 }, 407 },
408}; 408};
409 409module_platform_driver(tiny_spi_driver);
410static int __init tiny_spi_init(void)
411{
412 return platform_driver_register(&tiny_spi_driver);
413}
414module_init(tiny_spi_init);
415
416static void __exit tiny_spi_exit(void)
417{
418 platform_driver_unregister(&tiny_spi_driver);
419}
420module_exit(tiny_spi_exit);
421 410
422MODULE_DESCRIPTION("OpenCores tiny SPI driver"); 411MODULE_DESCRIPTION("OpenCores tiny SPI driver");
423MODULE_AUTHOR("Thomas Chou <thomas@wytron.com.tw>"); 412MODULE_AUTHOR("Thomas Chou <thomas@wytron.com.tw>");
diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c
index 8ec43e07aa1e..98ec53285fc7 100644
--- a/drivers/spi/spi-ppc4xx.c
+++ b/drivers/spi/spi-ppc4xx.c
@@ -594,18 +594,7 @@ static struct platform_driver spi_ppc4xx_of_driver = {
594 .of_match_table = spi_ppc4xx_of_match, 594 .of_match_table = spi_ppc4xx_of_match,
595 }, 595 },
596}; 596};
597 597module_platform_driver(spi_ppc4xx_of_driver);
598static int __init spi_ppc4xx_init(void)
599{
600 return platform_driver_register(&spi_ppc4xx_of_driver);
601}
602module_init(spi_ppc4xx_init);
603
604static void __exit spi_ppc4xx_exit(void)
605{
606 platform_driver_unregister(&spi_ppc4xx_of_driver);
607}
608module_exit(spi_ppc4xx_exit);
609 598
610MODULE_AUTHOR("Gary Jennejohn & Stefan Roese"); 599MODULE_AUTHOR("Gary Jennejohn & Stefan Roese");
611MODULE_DESCRIPTION("Simple PPC4xx SPI Driver"); 600MODULE_DESCRIPTION("Simple PPC4xx SPI Driver");
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>");
diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index e38554f89256..0f4834ae28cd 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -730,18 +730,7 @@ static struct platform_driver sh_msiof_spi_drv = {
730 .pm = &sh_msiof_spi_dev_pm_ops, 730 .pm = &sh_msiof_spi_dev_pm_ops,
731 }, 731 },
732}; 732};
733 733module_platform_driver(sh_msiof_spi_drv);
734static int __init sh_msiof_spi_init(void)
735{
736 return platform_driver_register(&sh_msiof_spi_drv);
737}
738module_init(sh_msiof_spi_init);
739
740static void __exit sh_msiof_spi_exit(void)
741{
742 platform_driver_unregister(&sh_msiof_spi_drv);
743}
744module_exit(sh_msiof_spi_exit);
745 734
746MODULE_DESCRIPTION("SuperH MSIOF SPI Master Interface Driver"); 735MODULE_DESCRIPTION("SuperH MSIOF SPI Master Interface Driver");
747MODULE_AUTHOR("Magnus Damm"); 736MODULE_AUTHOR("Magnus Damm");
diff --git a/drivers/spi/spi-sh-sci.c b/drivers/spi/spi-sh-sci.c
index e7779c09f6ef..8844bc342782 100644
--- a/drivers/spi/spi-sh-sci.c
+++ b/drivers/spi/spi-sh-sci.c
@@ -186,18 +186,7 @@ static struct platform_driver sh_sci_spi_drv = {
186 .owner = THIS_MODULE, 186 .owner = THIS_MODULE,
187 }, 187 },
188}; 188};
189 189module_platform_driver(sh_sci_spi_drv);
190static int __init sh_sci_spi_init(void)
191{
192 return platform_driver_register(&sh_sci_spi_drv);
193}
194module_init(sh_sci_spi_init);
195
196static void __exit sh_sci_spi_exit(void)
197{
198 platform_driver_unregister(&sh_sci_spi_drv);
199}
200module_exit(sh_sci_spi_exit);
201 190
202MODULE_DESCRIPTION("SH SCI SPI Driver"); 191MODULE_DESCRIPTION("SH SCI SPI Driver");
203MODULE_AUTHOR("Magnus Damm <damm@opensource.se>"); 192MODULE_AUTHOR("Magnus Damm <damm@opensource.se>");
diff --git a/drivers/spi/spi-sh.c b/drivers/spi/spi-sh.c
index e0343d48da6c..70c8af9f7ccc 100644
--- a/drivers/spi/spi-sh.c
+++ b/drivers/spi/spi-sh.c
@@ -524,18 +524,7 @@ static struct platform_driver spi_sh_driver = {
524 .owner = THIS_MODULE, 524 .owner = THIS_MODULE,
525 }, 525 },
526}; 526};
527 527module_platform_driver(spi_sh_driver);
528static int __init spi_sh_init(void)
529{
530 return platform_driver_register(&spi_sh_driver);
531}
532module_init(spi_sh_init);
533
534static void __exit spi_sh_exit(void)
535{
536 platform_driver_unregister(&spi_sh_driver);
537}
538module_exit(spi_sh_exit);
539 528
540MODULE_DESCRIPTION("SH SPI bus driver"); 529MODULE_DESCRIPTION("SH SPI bus driver");
541MODULE_LICENSE("GPL"); 530MODULE_LICENSE("GPL");
diff --git a/drivers/spi/spi-stmp.c b/drivers/spi/spi-stmp.c
index fadff76eb7e0..58e385285323 100644
--- a/drivers/spi/spi-stmp.c
+++ b/drivers/spi/spi-stmp.c
@@ -659,19 +659,8 @@ static struct platform_driver stmp_spi_driver = {
659 .suspend = stmp_spi_suspend, 659 .suspend = stmp_spi_suspend,
660 .resume = stmp_spi_resume, 660 .resume = stmp_spi_resume,
661}; 661};
662module_platform_driver(stmp_spi_driver);
662 663
663static int __init stmp_spi_init(void)
664{
665 return platform_driver_register(&stmp_spi_driver);
666}
667
668static void __exit stmp_spi_exit(void)
669{
670 platform_driver_unregister(&stmp_spi_driver);
671}
672
673module_init(stmp_spi_init);
674module_exit(stmp_spi_exit);
675module_param(pio, int, S_IRUGO); 664module_param(pio, int, S_IRUGO);
676module_param(clock, int, S_IRUGO); 665module_param(clock, int, S_IRUGO);
677MODULE_AUTHOR("dmitry pervushin <dpervushin@embeddedalley.com>"); 666MODULE_AUTHOR("dmitry pervushin <dpervushin@embeddedalley.com>");
diff --git a/drivers/spi/spi-tegra.c b/drivers/spi/spi-tegra.c
index e8cd58f63e22..ae6d78a3e912 100644
--- a/drivers/spi/spi-tegra.c
+++ b/drivers/spi/spi-tegra.c
@@ -465,7 +465,7 @@ static int spi_tegra_transfer(struct spi_device *spi, struct spi_message *m)
465 return 0; 465 return 0;
466} 466}
467 467
468static int __init spi_tegra_probe(struct platform_device *pdev) 468static int __devinit spi_tegra_probe(struct platform_device *pdev)
469{ 469{
470 struct spi_master *master; 470 struct spi_master *master;
471 struct spi_tegra_data *tspi; 471 struct spi_tegra_data *tspi;
@@ -613,19 +613,9 @@ static struct platform_driver spi_tegra_driver = {
613 .owner = THIS_MODULE, 613 .owner = THIS_MODULE,
614 .of_match_table = spi_tegra_of_match_table, 614 .of_match_table = spi_tegra_of_match_table,
615 }, 615 },
616 .probe = spi_tegra_probe,
616 .remove = __devexit_p(spi_tegra_remove), 617 .remove = __devexit_p(spi_tegra_remove),
617}; 618};
618 619module_platform_driver(spi_tegra_driver);
619static int __init spi_tegra_init(void)
620{
621 return platform_driver_probe(&spi_tegra_driver, spi_tegra_probe);
622}
623module_init(spi_tegra_init);
624
625static void __exit spi_tegra_exit(void)
626{
627 platform_driver_unregister(&spi_tegra_driver);
628}
629module_exit(spi_tegra_exit);
630 620
631MODULE_LICENSE("GPL"); 621MODULE_LICENSE("GPL");
diff --git a/drivers/spi/spi-ti-ssp.c b/drivers/spi/spi-ti-ssp.c
index ee22795c7973..7963c60063d6 100644
--- a/drivers/spi/spi-ti-ssp.c
+++ b/drivers/spi/spi-ti-ssp.c
@@ -383,18 +383,7 @@ static struct platform_driver ti_ssp_spi_driver = {
383 .owner = THIS_MODULE, 383 .owner = THIS_MODULE,
384 }, 384 },
385}; 385};
386 386module_platform_driver(ti_ssp_spi_driver);
387static int __init ti_ssp_spi_init(void)
388{
389 return platform_driver_register(&ti_ssp_spi_driver);
390}
391module_init(ti_ssp_spi_init);
392
393static void __exit ti_ssp_spi_exit(void)
394{
395 platform_driver_unregister(&ti_ssp_spi_driver);
396}
397module_exit(ti_ssp_spi_exit);
398 387
399MODULE_DESCRIPTION("SSP SPI Master"); 388MODULE_DESCRIPTION("SSP SPI Master");
400MODULE_AUTHOR("Cyril Chemparathy"); 389MODULE_AUTHOR("Cyril Chemparathy");
diff --git a/drivers/spi/spi-xilinx.c b/drivers/spi/spi-xilinx.c
index 4d2c75df886c..4c5a663b9fa8 100644
--- a/drivers/spi/spi-xilinx.c
+++ b/drivers/spi/spi-xilinx.c
@@ -538,18 +538,7 @@ static struct platform_driver xilinx_spi_driver = {
538 .of_match_table = xilinx_spi_of_match, 538 .of_match_table = xilinx_spi_of_match,
539 }, 539 },
540}; 540};
541 541module_platform_driver(xilinx_spi_driver);
542static int __init xilinx_spi_pltfm_init(void)
543{
544 return platform_driver_register(&xilinx_spi_driver);
545}
546module_init(xilinx_spi_pltfm_init);
547
548static void __exit xilinx_spi_pltfm_exit(void)
549{
550 platform_driver_unregister(&xilinx_spi_driver);
551}
552module_exit(xilinx_spi_pltfm_exit);
553 542
554MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>"); 543MODULE_AUTHOR("MontaVista Software, Inc. <source@mvista.com>");
555MODULE_DESCRIPTION("Xilinx SPI driver"); 544MODULE_DESCRIPTION("Xilinx SPI driver");