mmc: convert drivers/mmc/host/* to use module_platform_driver()
authorAxel Lin <axel.lin@gmail.com>
Sat, 26 Nov 2011 04:55:43 +0000 (12:55 +0800)
committerChris Ball <cjb@laptop.org>
Thu, 12 Jan 2012 04:58:42 +0000 (23:58 -0500)
This patch converts the drivers in drivers/mmc/host/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Acked-by: David Brown <davidb@codeaurora.org>
Acked-by: Viresh Kumar <viresh.kumar@st.com>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
21 files changed:
drivers/mmc/host/bfin_sdh.c
drivers/mmc/host/cb710-mmc.c
drivers/mmc/host/jz4740_mmc.c
drivers/mmc/host/msm_sdcc.c
drivers/mmc/host/mxcmmc.c
drivers/mmc/host/mxs-mmc.c
drivers/mmc/host/pxamci.c
drivers/mmc/host/s3cmci.c
drivers/mmc/host/sdhci-cns3xxx.c
drivers/mmc/host/sdhci-dove.c
drivers/mmc/host/sdhci-esdhc-imx.c
drivers/mmc/host/sdhci-of-esdhc.c
drivers/mmc/host/sdhci-of-hlwd.c
drivers/mmc/host/sdhci-pxav2.c
drivers/mmc/host/sdhci-pxav3.c
drivers/mmc/host/sdhci-s3c.c
drivers/mmc/host/sdhci-spear.c
drivers/mmc/host/sdhci-tegra.c
drivers/mmc/host/sh_mmcif.c
drivers/mmc/host/sh_mobile_sdhi.c
drivers/mmc/host/tmio_mmc.c

index 0371bf502249baf416d78b85c88ca1ba218f28b0..03666174ca483e61a351626ad428a9bc833ef981 100644 (file)
@@ -627,17 +627,7 @@ static struct platform_driver sdh_driver = {
        },
 };
 
-static int __init sdh_init(void)
-{
-       return platform_driver_register(&sdh_driver);
-}
-module_init(sdh_init);
-
-static void __exit sdh_exit(void)
-{
-       platform_driver_unregister(&sdh_driver);
-}
-module_exit(sdh_exit);
+module_platform_driver(sdh_driver);
 
 MODULE_DESCRIPTION("Blackfin Secure Digital Host Driver");
 MODULE_AUTHOR("Cliff Cai, Roy Huang");
index ce2a47b71dd6a0fe8b73d5eefb616607d04fe731..83693fd7c6b35718e5a65d81d3e8499a7694a378 100644 (file)
@@ -780,18 +780,7 @@ static struct platform_driver cb710_mmc_driver = {
 #endif
 };
 
-static int __init cb710_mmc_init_module(void)
-{
-       return platform_driver_register(&cb710_mmc_driver);
-}
-
-static void __exit cb710_mmc_cleanup_module(void)
-{
-       platform_driver_unregister(&cb710_mmc_driver);
-}
-
-module_init(cb710_mmc_init_module);
-module_exit(cb710_mmc_cleanup_module);
+module_platform_driver(cb710_mmc_driver);
 
 MODULE_AUTHOR("Michał Mirosław <mirq-linux@rere.qmqm.pl>");
 MODULE_DESCRIPTION("ENE CB710 memory card reader driver - MMC/SD part");
index 74218ad677e4955d2dcb0941f68ed45c3fa4e85b..c8852a8128a90c119d7d53c5eec5381aa9678008 100644 (file)
@@ -1012,17 +1012,7 @@ static struct platform_driver jz4740_mmc_driver = {
        },
 };
 
-static int __init jz4740_mmc_init(void)
-{
-       return platform_driver_register(&jz4740_mmc_driver);
-}
-module_init(jz4740_mmc_init);
-
-static void __exit jz4740_mmc_exit(void)
-{
-       platform_driver_unregister(&jz4740_mmc_driver);
-}
-module_exit(jz4740_mmc_exit);
+module_platform_driver(jz4740_mmc_driver);
 
 MODULE_DESCRIPTION("JZ4740 SD/MMC controller driver");
 MODULE_LICENSE("GPL");
index 80d8eb143b486c92ee143f6e70992570625e33e3..475596653c197b51ca88c440a0488aef21e30fec 100644 (file)
@@ -1480,18 +1480,7 @@ static struct platform_driver msmsdcc_driver = {
        },
 };
 
-static int __init msmsdcc_init(void)
-{
-       return platform_driver_register(&msmsdcc_driver);
-}
-
-static void __exit msmsdcc_exit(void)
-{
-       platform_driver_unregister(&msmsdcc_driver);
-}
-
-module_init(msmsdcc_init);
-module_exit(msmsdcc_exit);
+module_platform_driver(msmsdcc_driver);
 
 MODULE_DESCRIPTION("Qualcomm MSM 7X00A Multimedia Card Interface driver");
 MODULE_LICENSE("GPL");
index 8e0fbe99404778ee1cc4f512b767479d7dad9855..7088b40f95797b00172edf0bdf4f50437b18947f 100644 (file)
@@ -1047,18 +1047,7 @@ static struct platform_driver mxcmci_driver = {
        }
 };
 
-static int __init mxcmci_init(void)
-{
-       return platform_driver_register(&mxcmci_driver);
-}
-
-static void __exit mxcmci_exit(void)
-{
-       platform_driver_unregister(&mxcmci_driver);
-}
-
-module_init(mxcmci_init);
-module_exit(mxcmci_exit);
+module_platform_driver(mxcmci_driver);
 
 MODULE_DESCRIPTION("i.MX Multimedia Card Interface Driver");
 MODULE_AUTHOR("Sascha Hauer, Pengutronix");
index 99b449d26a4d39579c787871ca448e50bed8a37a..cf18fc2b24cdb23c9b01a811222a73c21fdee4bc 100644 (file)
@@ -855,18 +855,7 @@ static struct platform_driver mxs_mmc_driver = {
        },
 };
 
-static int __init mxs_mmc_init(void)
-{
-       return platform_driver_register(&mxs_mmc_driver);
-}
-
-static void __exit mxs_mmc_exit(void)
-{
-       platform_driver_unregister(&mxs_mmc_driver);
-}
-
-module_init(mxs_mmc_init);
-module_exit(mxs_mmc_exit);
+module_platform_driver(mxs_mmc_driver);
 
 MODULE_DESCRIPTION("FREESCALE MXS MMC peripheral");
 MODULE_AUTHOR("Freescale Semiconductor");
index fc4356e00d46ff7366ed38a6f76ab2f3e2c9cbce..cb2dc0e75ba7fc1ff8d6610176326fa4eb675a5d 100644 (file)
@@ -872,18 +872,7 @@ static struct platform_driver pxamci_driver = {
        },
 };
 
-static int __init pxamci_init(void)
-{
-       return platform_driver_register(&pxamci_driver);
-}
-
-static void __exit pxamci_exit(void)
-{
-       platform_driver_unregister(&pxamci_driver);
-}
-
-module_init(pxamci_init);
-module_exit(pxamci_exit);
+module_platform_driver(pxamci_driver);
 
 MODULE_DESCRIPTION("PXA Multimedia Card Interface Driver");
 MODULE_LICENSE("GPL");
index 720f99334a7f95ffb7f133b2710b7294abe70369..1bcfd6dbb5cc242eb97de198f3eb383d85655e98 100644 (file)
@@ -1914,18 +1914,7 @@ static struct platform_driver s3cmci_driver = {
        .shutdown       = s3cmci_shutdown,
 };
 
-static int __init s3cmci_init(void)
-{
-       return platform_driver_register(&s3cmci_driver);
-}
-
-static void __exit s3cmci_exit(void)
-{
-       platform_driver_unregister(&s3cmci_driver);
-}
-
-module_init(s3cmci_init);
-module_exit(s3cmci_exit);
+module_platform_driver(s3cmci_driver);
 
 MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
 MODULE_LICENSE("GPL v2");
index b4257e700617c6e4f51455a462df1f063dfa0294..28a870804f60bc3cb0dbbe5e7a9d48e3e9088004 100644 (file)
@@ -115,17 +115,7 @@ static struct platform_driver sdhci_cns3xxx_driver = {
        .remove         = __devexit_p(sdhci_cns3xxx_remove),
 };
 
-static int __init sdhci_cns3xxx_init(void)
-{
-       return platform_driver_register(&sdhci_cns3xxx_driver);
-}
-module_init(sdhci_cns3xxx_init);
-
-static void __exit sdhci_cns3xxx_exit(void)
-{
-       platform_driver_unregister(&sdhci_cns3xxx_driver);
-}
-module_exit(sdhci_cns3xxx_exit);
+module_platform_driver(sdhci_cns3xxx_driver);
 
 MODULE_DESCRIPTION("SDHCI driver for CNS3xxx");
 MODULE_AUTHOR("Scott Shu, "
index a81312c91f7086625d10f963df9f31c0b64e0c4c..46fd1fd1b605033b8f437a70da844f11f5e04226 100644 (file)
@@ -88,17 +88,7 @@ static struct platform_driver sdhci_dove_driver = {
        .remove         = __devexit_p(sdhci_dove_remove),
 };
 
-static int __init sdhci_dove_init(void)
-{
-       return platform_driver_register(&sdhci_dove_driver);
-}
-module_init(sdhci_dove_init);
-
-static void __exit sdhci_dove_exit(void)
-{
-       platform_driver_unregister(&sdhci_dove_driver);
-}
-module_exit(sdhci_dove_exit);
+module_platform_driver(sdhci_dove_driver);
 
 MODULE_DESCRIPTION("SDHCI driver for Dove");
 MODULE_AUTHOR("Saeed Bishara <saeed@marvell.com>, "
index 38ebc4ea259fcb659f855fe446e45e0dc7fa9952..d601e41af282105ad5c3a86d30d569dfef3def8c 100644 (file)
@@ -606,17 +606,7 @@ static struct platform_driver sdhci_esdhc_imx_driver = {
        .remove         = __devexit_p(sdhci_esdhc_imx_remove),
 };
 
-static int __init sdhci_esdhc_imx_init(void)
-{
-       return platform_driver_register(&sdhci_esdhc_imx_driver);
-}
-module_init(sdhci_esdhc_imx_init);
-
-static void __exit sdhci_esdhc_imx_exit(void)
-{
-       platform_driver_unregister(&sdhci_esdhc_imx_driver);
-}
-module_exit(sdhci_esdhc_imx_exit);
+module_platform_driver(sdhci_esdhc_imx_driver);
 
 MODULE_DESCRIPTION("SDHCI driver for Freescale i.MX eSDHC");
 MODULE_AUTHOR("Wolfram Sang <w.sang@pengutronix.de>");
index 01e5f627e0f047b2a7c63474a931fbedab0a1444..ff4adc0180418578ff10594f3f80cb2c0564d756 100644 (file)
@@ -131,17 +131,7 @@ static struct platform_driver sdhci_esdhc_driver = {
        .remove = __devexit_p(sdhci_esdhc_remove),
 };
 
-static int __init sdhci_esdhc_init(void)
-{
-       return platform_driver_register(&sdhci_esdhc_driver);
-}
-module_init(sdhci_esdhc_init);
-
-static void __exit sdhci_esdhc_exit(void)
-{
-       platform_driver_unregister(&sdhci_esdhc_driver);
-}
-module_exit(sdhci_esdhc_exit);
+module_platform_driver(sdhci_esdhc_driver);
 
 MODULE_DESCRIPTION("SDHCI OF driver for Freescale MPC eSDHC");
 MODULE_AUTHOR("Xiaobo Xie <X.Xie@freescale.com>, "
index 3619adc7d9fc36548283386f82e08be2d195a608..0ce088ae02289ecf743e00c120a210e7de550d45 100644 (file)
@@ -93,17 +93,7 @@ static struct platform_driver sdhci_hlwd_driver = {
        .remove = __devexit_p(sdhci_hlwd_remove),
 };
 
-static int __init sdhci_hlwd_init(void)
-{
-       return platform_driver_register(&sdhci_hlwd_driver);
-}
-module_init(sdhci_hlwd_init);
-
-static void __exit sdhci_hlwd_exit(void)
-{
-       platform_driver_unregister(&sdhci_hlwd_driver);
-}
-module_exit(sdhci_hlwd_exit);
+module_platform_driver(sdhci_hlwd_driver);
 
 MODULE_DESCRIPTION("Nintendo Wii SDHCI OF driver");
 MODULE_AUTHOR("The GameCube Linux Team, Albert Herranz");
index 7a039c3cb1f10a8651ae04091c8303008ad2cbe2..dbb75bfbcffb3e181f6d0af195209e5187c3b210 100644 (file)
@@ -223,18 +223,8 @@ static struct platform_driver sdhci_pxav2_driver = {
        .probe          = sdhci_pxav2_probe,
        .remove         = __devexit_p(sdhci_pxav2_remove),
 };
-static int __init sdhci_pxav2_init(void)
-{
-       return platform_driver_register(&sdhci_pxav2_driver);
-}
-
-static void __exit sdhci_pxav2_exit(void)
-{
-       platform_driver_unregister(&sdhci_pxav2_driver);
-}
 
-module_init(sdhci_pxav2_init);
-module_exit(sdhci_pxav2_exit);
+module_platform_driver(sdhci_pxav2_driver);
 
 MODULE_DESCRIPTION("SDHCI driver for pxav2");
 MODULE_AUTHOR("Marvell International Ltd.");
index 15673a7ee6a59a70d7455179f3afe30b3fb15588..f29695683556df8f7c01ad6f145a9fc36583e410 100644 (file)
@@ -269,18 +269,8 @@ static struct platform_driver sdhci_pxav3_driver = {
        .probe          = sdhci_pxav3_probe,
        .remove         = __devexit_p(sdhci_pxav3_remove),
 };
-static int __init sdhci_pxav3_init(void)
-{
-       return platform_driver_register(&sdhci_pxav3_driver);
-}
-
-static void __exit sdhci_pxav3_exit(void)
-{
-       platform_driver_unregister(&sdhci_pxav3_driver);
-}
 
-module_init(sdhci_pxav3_init);
-module_exit(sdhci_pxav3_exit);
+module_platform_driver(sdhci_pxav3_driver);
 
 MODULE_DESCRIPTION("SDHCI driver for pxav3");
 MODULE_AUTHOR("Marvell International Ltd.");
index 0d33ff0d67fbf7abf46f496c14e61dbdd3a9f6a4..55c1e870da83ad2fd6bb2461942d4ff98f616747 100644 (file)
@@ -657,18 +657,7 @@ static struct platform_driver sdhci_s3c_driver = {
        },
 };
 
-static int __init sdhci_s3c_init(void)
-{
-       return platform_driver_register(&sdhci_s3c_driver);
-}
-
-static void __exit sdhci_s3c_exit(void)
-{
-       platform_driver_unregister(&sdhci_s3c_driver);
-}
-
-module_init(sdhci_s3c_init);
-module_exit(sdhci_s3c_exit);
+module_platform_driver(sdhci_s3c_driver);
 
 MODULE_DESCRIPTION("Samsung SDHCI (HSMMC) glue");
 MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>");
index dee70b66305afc2e08877282647171405918edea..883548eaa09e7fccd2f6987b1159a0fff1c3f060 100644 (file)
@@ -320,17 +320,7 @@ static struct platform_driver sdhci_driver = {
        .remove         = __devexit_p(sdhci_remove),
 };
 
-static int __init sdhci_init(void)
-{
-       return platform_driver_register(&sdhci_driver);
-}
-module_init(sdhci_init);
-
-static void __exit sdhci_exit(void)
-{
-       platform_driver_unregister(&sdhci_driver);
-}
-module_exit(sdhci_exit);
+module_platform_driver(sdhci_driver);
 
 MODULE_DESCRIPTION("SPEAr Secure Digital Host Controller Interface driver");
 MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>");
index e2e18d3f949c45dda79395646484a848a84d9326..78a36eba4df0b77d5fd433a3a805373484c50c22 100644 (file)
@@ -324,17 +324,7 @@ static struct platform_driver sdhci_tegra_driver = {
        .remove         = __devexit_p(sdhci_tegra_remove),
 };
 
-static int __init sdhci_tegra_init(void)
-{
-       return platform_driver_register(&sdhci_tegra_driver);
-}
-module_init(sdhci_tegra_init);
-
-static void __exit sdhci_tegra_exit(void)
-{
-       platform_driver_unregister(&sdhci_tegra_driver);
-}
-module_exit(sdhci_tegra_exit);
+module_platform_driver(sdhci_tegra_driver);
 
 MODULE_DESCRIPTION("SDHCI driver for Tegra");
 MODULE_AUTHOR(" Google, Inc.");
index 2ec23b0053b661d6de8ffd3d2e05eba325d9fb1e..7bec007bcefafcddb5e691df07aeccc5a910b54a 100644 (file)
@@ -1207,19 +1207,7 @@ static struct platform_driver sh_mmcif_driver = {
        },
 };
 
-static int __init sh_mmcif_init(void)
-{
-       return platform_driver_register(&sh_mmcif_driver);
-}
-
-static void __exit sh_mmcif_exit(void)
-{
-       platform_driver_unregister(&sh_mmcif_driver);
-}
-
-module_init(sh_mmcif_init);
-module_exit(sh_mmcif_exit);
-
+module_platform_driver(sh_mmcif_driver);
 
 MODULE_DESCRIPTION("SuperH on-chip MMC/eMMC interface driver");
 MODULE_LICENSE("GPL");
index 41ae6466bd83e8b65b87d0da122afe54bdc93fb3..58da3c44acc5d129428198b7ec80f987fe73d68a 100644 (file)
@@ -282,18 +282,7 @@ static struct platform_driver sh_mobile_sdhi_driver = {
        .remove         = __devexit_p(sh_mobile_sdhi_remove),
 };
 
-static int __init sh_mobile_sdhi_init(void)
-{
-       return platform_driver_register(&sh_mobile_sdhi_driver);
-}
-
-static void __exit sh_mobile_sdhi_exit(void)
-{
-       platform_driver_unregister(&sh_mobile_sdhi_driver);
-}
-
-module_init(sh_mobile_sdhi_init);
-module_exit(sh_mobile_sdhi_exit);
+module_platform_driver(sh_mobile_sdhi_driver);
 
 MODULE_DESCRIPTION("SuperH Mobile SDHI driver");
 MODULE_AUTHOR("Magnus Damm");
index a4ea10242787465d21f99e93e11516d8090cdef1..113ce6c9cf3203d1ad71f445ce62b63be6f2eca5 100644 (file)
@@ -138,19 +138,7 @@ static struct platform_driver tmio_mmc_driver = {
        .resume = tmio_mmc_resume,
 };
 
-
-static int __init tmio_mmc_init(void)
-{
-       return platform_driver_register(&tmio_mmc_driver);
-}
-
-static void __exit tmio_mmc_exit(void)
-{
-       platform_driver_unregister(&tmio_mmc_driver);
-}
-
-module_init(tmio_mmc_init);
-module_exit(tmio_mmc_exit);
+module_platform_driver(tmio_mmc_driver);
 
 MODULE_DESCRIPTION("Toshiba TMIO SD/MMC driver");
 MODULE_AUTHOR("Ian Molton <spyro@f2s.com>");