Skip to contentSkip to conversation

mmc: convert drivers/mmc/host/* to use module_platform_driver()

PATCH In review Axel Lin 9 participants 11 messages Nov 26, 2011 – Dec 2, 2011

Subsystems (10)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 mmc: convert drivers/mmc/host/* to use module_platform_driver()

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.

Cc "Michał Mirosław" <[email protected]>
Cc David Brown <[email protected]>
Cc Ben Dooks <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Guennadi Liakhovetski <[email protected]>
Cc Ian Molton <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc Grant Likely <[email protected]>
Cc Anton Vorontsov <[email protected]>
Cc Linus Walleij <[email protected]>
---
 drivers/mmc/host/bfin_sdh.c        |   12 +-----------
 drivers/mmc/host/cb710-mmc.c       |   13 +------------
 drivers/mmc/host/jz4740_mmc.c      |   12 +-----------
 drivers/mmc/host/msm_sdcc.c        |   13 +------------
 drivers/mmc/host/mxcmmc.c          |   13 +------------
 drivers/mmc/host/mxs-mmc.c         |   13 +------------
 drivers/mmc/host/pxamci.c          |   13 +------------
 drivers/mmc/host/s3cmci.c          |   13 +------------
 drivers/mmc/host/sdhci-cns3xxx.c   |   12 +-----------
 drivers/mmc/host/sdhci-dove.c      |   12 +-----------
 drivers/mmc/host/sdhci-esdhc-imx.c |   12 +-----------
 drivers/mmc/host/sdhci-of-esdhc.c  |   12 +-----------
 drivers/mmc/host/sdhci-of-hlwd.c   |   12 +-----------
 drivers/mmc/host/sdhci-pxav2.c     |   12 +-----------
 drivers/mmc/host/sdhci-pxav3.c     |   12 +-----------
 drivers/mmc/host/sdhci-s3c.c       |   13 +------------
 drivers/mmc/host/sdhci-spear.c     |   12 +-----------
 drivers/mmc/host/sdhci-tegra.c     |   12 +-----------
 drivers/mmc/host/sh_mmcif.c        |   14 +-------------
 drivers/mmc/host/sh_mobile_sdhi.c  |   13 +------------
 drivers/mmc/host/tmio_mmc.c        |   14 +-------------
 21 files changed, 21 insertions(+), 243 deletions(-)
drivers/mmc/host/bfin_sdh.c +1 -11
index 0371bf5..0366617 100644
@@ -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");
drivers/mmc/host/cb710-mmc.c +1 -12
index ce2a47b..83693fd 100644
@@ -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 <[email protected]>");
 MODULE_DESCRIPTION("ENE CB710 memory card reader driver - MMC/SD part");
drivers/mmc/host/jz4740_mmc.c +1 -11
index 74218ad..c8852a8 100644
@@ -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");
drivers/mmc/host/msm_sdcc.c +1 -12
index 80d8eb1..4755966 100644
@@ -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");
drivers/mmc/host/mxcmmc.c +1 -12
index f07bd87..4184b79 100644
@@ -1051,18 +1051,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");
drivers/mmc/host/mxs-mmc.c +1 -12
index 0a878b1..571c9ff 100644
@@ -860,18 +860,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");
drivers/mmc/host/pxamci.c +1 -12
index fc4356e..cb2dc0e 100644
@@ -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");
drivers/mmc/host/s3cmci.c +1 -12
index 720f993..1bcfd6d 100644
@@ -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");
drivers/mmc/host/sdhci-cns3xxx.c +1 -11
index b4257e7..28a8708 100644
@@ -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, "
drivers/mmc/host/sdhci-dove.c +1 -11
index a81312c..46fd1fd 100644
@@ -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 <[email protected]>, "
drivers/mmc/host/sdhci-esdhc-imx.c +1 -11
index 38ebc4e..d601e41 100644
@@ -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 <[email protected]>");
drivers/mmc/host/sdhci-of-esdhc.c +1 -11
index 01e5f62..ff4adc0 100644
@@ -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 <[email protected]>, "
drivers/mmc/host/sdhci-of-hlwd.c +1 -11
index 3619adc..0ce088ae 100644
@@ -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");
drivers/mmc/host/sdhci-pxav2.c +1 -11
index 7a039c3..dbb75bf 100644
@@ -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.");
drivers/mmc/host/sdhci-pxav3.c +1 -11
index 15673a7..f296956 100644
@@ -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.");
drivers/mmc/host/sdhci-s3c.c +1 -12
index 4cb272c..c28ab53 100644
@@ -656,18 +656,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, <[email protected]>");
drivers/mmc/host/sdhci-spear.c +1 -11
index dee70b6..883548e 100644
@@ -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 <[email protected]>");
drivers/mmc/host/sdhci-tegra.c +1 -11
index e2e18d3..78a36eb 100644
@@ -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.");
drivers/mmc/host/sh_mmcif.c +1 -13
index 1c0c10b..591345d3 100644
@@ -1206,19 +1206,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");
drivers/mmc/host/sh_mobile_sdhi.c +1 -12
index 41ae646..58da3c4 100644
@@ -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");
drivers/mmc/host/tmio_mmc.c +1 -13
index a4ea102..113ce6c 100644
@@ -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 <[email protected]>");
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 3 lines · Axel Lin

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.

Personally I would prefer the macro name capitalized.

Other than that, it look OK.

Thanks,

Signature · 2 lines
Anton Vorontsov
Email: [email protected]
Acked-by
#2 lore raw
Quoted 4 lines · Anton Vorontsov
Quoted 3 lines · Axel Lin

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.

Lost the original mail, but checked the patch using an archive.

Signature · 2 lines
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Axel Lin
Quoted 3 lines · Axel Lin

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.

[...]

Quoted 9 lines
drivers/mmc/host/cb710-mmc.c +0 -3
@@ -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);

drivers/mmc/host/cb710-mmc.c static struct platform_driver cb710_mmc_driver = { · line 783

Quoted 10 lines
drivers/mmc/host/cb710-mmc.c +1 -9
-}
-
-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);

No functional change, so:

Acked-by on v1 1/1
#4 lore raw
In reply to Axel Lin
Quoted 54 lines · Axel Lin

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.

Cc "Michał Mirosław" <[email protected]>
Cc David Brown <[email protected]>
Cc Ben Dooks <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Guennadi Liakhovetski <[email protected]>
Cc Ian Molton <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc Grant Likely <[email protected]>
Cc Anton Vorontsov <[email protected]>
Cc Linus Walleij <[email protected]>

---
 drivers/mmc/host/bfin_sdh.c        |   12 +----------- drivers/mmc/host/cb710-mmc.c       |   13 +------------ drivers/mmc/host/jz4740_mmc.c      |   12 +----------- drivers/mmc/host/msm_sdcc.c        |   13 +------------ drivers/mmc/host/mxcmmc.c          |   13 +------------ drivers/mmc/host/mxs-mmc.c         |   13 +------------ drivers/mmc/host/pxamci.c          |   13 +------------ drivers/mmc/host/s3cmci.c          |   13 +------------ drivers/mmc/host/sdhci-cns3xxx.c   |   12 +----------- drivers/mmc/host/sdhci-dove.c      |   12 +----------- drivers/mmc/host/sdhci-esdhc-imx.c |   12 +----------- drivers/mmc/host/sdhci-of-esdhc.c  |   12 +----------- drivers/mmc/host/sdhci-of-hlwd.c   |   12 +----------- drivers/mmc/host/sdhci-pxav2.c     |   12 +----------- drivers/mmc/host/sdhci-pxav3.c     |   12 +----------- drivers/mmc/host/sdhci-s3c.c       |   13 +------------ drivers/mmc/host/sdhci-spear.c     |   12 +----------- drivers/mmc/host/sdhci-tegra.c     |   12 +----------- drivers/mmc/host/sh_mmcif.c        |   14 +------------- drivers/mmc/host/sh_mobile_sdhi.c  |   13 +------------ drivers/mmc/host/tmio_mmc.c        |   14 +-------------

 21 files changed, 21 insertions(+), 243 deletions(-)
drivers/mmc/host/sdhci-spear.c +0 -5
index dee70b6..883548e 100644
@@ -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);

drivers/mmc/host/sdhci-spear.c static struct platform_driver sdhci_driver = { · line 326

Quoted 10 lines
drivers/mmc/host/sdhci-spear.c +1 -6
-
-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 <[email protected]>");

For SPEAr:

Acked-by on v1 1/1
#5 lore raw
In reply to Axel Lin
Quoted 4 lines · Axel Lin

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.

Quoted 12 lines
Cc "Michał Mirosław" <[email protected]>
Cc David Brown <[email protected]>
Cc Ben Dooks <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Guennadi Liakhovetski <[email protected]>
Cc Ian Molton <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc Grant Likely <[email protected]>
Cc Anton Vorontsov <[email protected]>
Cc Linus Walleij <[email protected]>

For tmio_mmc.c, sh_mobile_sdhi.c and sh_mmcif.c:

Thanks
Guennadi

Quoted 526 lines
---
 drivers/mmc/host/bfin_sdh.c        |   12 +-----------
 drivers/mmc/host/cb710-mmc.c       |   13 +------------
 drivers/mmc/host/jz4740_mmc.c      |   12 +-----------
 drivers/mmc/host/msm_sdcc.c        |   13 +------------
 drivers/mmc/host/mxcmmc.c          |   13 +------------
 drivers/mmc/host/mxs-mmc.c         |   13 +------------
 drivers/mmc/host/pxamci.c          |   13 +------------
 drivers/mmc/host/s3cmci.c          |   13 +------------
 drivers/mmc/host/sdhci-cns3xxx.c   |   12 +-----------
 drivers/mmc/host/sdhci-dove.c      |   12 +-----------
 drivers/mmc/host/sdhci-esdhc-imx.c |   12 +-----------
 drivers/mmc/host/sdhci-of-esdhc.c  |   12 +-----------
 drivers/mmc/host/sdhci-of-hlwd.c   |   12 +-----------
 drivers/mmc/host/sdhci-pxav2.c     |   12 +-----------
 drivers/mmc/host/sdhci-pxav3.c     |   12 +-----------
 drivers/mmc/host/sdhci-s3c.c       |   13 +------------
 drivers/mmc/host/sdhci-spear.c     |   12 +-----------
 drivers/mmc/host/sdhci-tegra.c     |   12 +-----------
 drivers/mmc/host/sh_mmcif.c        |   14 +-------------
 drivers/mmc/host/sh_mobile_sdhi.c  |   13 +------------
 drivers/mmc/host/tmio_mmc.c        |   14 +-------------
 21 files changed, 21 insertions(+), 243 deletions(-)
drivers/mmc/host/bfin_sdh.c +1 -11
index 0371bf5..0366617 100644
@@ -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");
drivers/mmc/host/cb710-mmc.c +1 -12
index ce2a47b..83693fd 100644
@@ -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 <[email protected]>");
 MODULE_DESCRIPTION("ENE CB710 memory card reader driver - MMC/SD part");
drivers/mmc/host/jz4740_mmc.c +1 -11
index 74218ad..c8852a8 100644
@@ -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");
drivers/mmc/host/msm_sdcc.c +1 -12
index 80d8eb1..4755966 100644
@@ -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");
drivers/mmc/host/mxcmmc.c +1 -12
index f07bd87..4184b79 100644
@@ -1051,18 +1051,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");
drivers/mmc/host/mxs-mmc.c +1 -12
index 0a878b1..571c9ff 100644
@@ -860,18 +860,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");
drivers/mmc/host/pxamci.c +1 -12
index fc4356e..cb2dc0e 100644
@@ -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");
drivers/mmc/host/s3cmci.c +1 -12
index 720f993..1bcfd6d 100644
@@ -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");
drivers/mmc/host/sdhci-cns3xxx.c +1 -11
index b4257e7..28a8708 100644
@@ -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, "
drivers/mmc/host/sdhci-dove.c +1 -11
index a81312c..46fd1fd 100644
@@ -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 <[email protected]>, "
drivers/mmc/host/sdhci-esdhc-imx.c +1 -11
index 38ebc4e..d601e41 100644
@@ -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 <[email protected]>");
drivers/mmc/host/sdhci-of-esdhc.c +1 -11
index 01e5f62..ff4adc0 100644
@@ -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 <[email protected]>, "
drivers/mmc/host/sdhci-of-hlwd.c +1 -11
index 3619adc..0ce088ae 100644
@@ -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");
drivers/mmc/host/sdhci-pxav2.c +1 -11
index 7a039c3..dbb75bf 100644
@@ -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.");
drivers/mmc/host/sdhci-pxav3.c +1 -11
index 15673a7..f296956 100644
@@ -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.");
drivers/mmc/host/sdhci-s3c.c +1 -12
index 4cb272c..c28ab53 100644
@@ -656,18 +656,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, <[email protected]>");
drivers/mmc/host/sdhci-spear.c +1 -11
index dee70b6..883548e 100644
@@ -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 <[email protected]>");
drivers/mmc/host/sdhci-tegra.c +1 -11
index e2e18d3..78a36eb 100644
@@ -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.");
drivers/mmc/host/sh_mmcif.c +1 -13
index 1c0c10b..591345d3 100644
@@ -1206,19 +1206,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");
drivers/mmc/host/sh_mobile_sdhi.c +1 -12
index 41ae646..58da3c4 100644
@@ -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");
drivers/mmc/host/tmio_mmc.c +1 -13
index a4ea102..113ce6c 100644
@@ -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 <[email protected]>");
Signature · 1 line
1.7.5.4

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

maintainer Acked-by on v1 1/1
#6 lore raw
In reply to Axel Lin
Quoted 4 lines · Axel Lin

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.

Quoted 12 lines
Cc "Michał Mirosław" <[email protected]>
Cc David Brown <[email protected]>
Cc Ben Dooks <[email protected]>
Cc Viresh Kumar <[email protected]>
Cc Guennadi Liakhovetski <[email protected]>
Cc Ian Molton <[email protected]>
Cc Sascha Hauer <[email protected]>
Cc Wolfram Sang <[email protected]>
Cc Grant Likely <[email protected]>
Cc Anton Vorontsov <[email protected]>
Cc Linus Walleij <[email protected]>

For the mxcmmc driver:

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
Acked-by on v1 1/1
#7 lore raw
In reply to Axel Lin
Quoted 5 lines · Axel Lin

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.

 drivers/mmc/host/msm_sdcc.c        |   13 +------------
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#8 lore raw
In reply to Axel Lin

Hi Axel, Micha,

Quoted 3 lines · Axel Lin

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.

This makes cb710_mmc unhappy:

/home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: data definition has no type or storage class [enabled by default] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: type defaults to ‘int’ in declaration of ‘module_platform_driver’ [-Wimplicit-int] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: parameter names (without types) in function declaration [enabled by default] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:773:31: warning: ‘cb710_mmc_driver’ defined but not used [-Wunused-variable]

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child
author
#9 lore raw

2011/12/2 Chris Ball <[email protected]>:

Quoted 7 lines

Hi Axel, Micha,

Quoted 3 lines · Axel Lin

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.

Quoted 6 lines

This makes cb710_mmc unhappy:

/home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: data definition has no type or storage class [enabled by default] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: type defaults to ‘int’ in declaration of ‘module_platform_driver’ [-Wimplicit-int] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: parameter names (without types) in function declaration [enabled by default] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:773:31: warning: ‘cb710_mmc_driver’ defined but not used [-Wunused-variable]

Strange. I don't see above warning in my build after apply this patch. ( Tested on linux-next tree ).

Axel

author
#10 lore raw

Hi Chris,

2011/12/2 Axel Lin <[email protected]>:

Quoted 10 lines

2011/12/2 Chris Ball <[email protected]>:

Quoted 9 lines

Hi Axel, Micha,

Quoted 3 lines · Axel Lin

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.

This makes cb710_mmc unhappy:

Quoted 8 lines
Quoted 4 lines

/home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: data definition has no type or storage class [enabled by default] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: type defaults to ‘int’ in declaration of ‘module_platform_driver’ [-Wimplicit-int] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:783:1: warning: parameter names (without types) in function declaration [enabled by default] /home/cjb/git/mmc/drivers/mmc/host/cb710-mmc.c:773:31: warning: ‘cb710_mmc_driver’ defined but not used [-Wunused-variable]

Strange. I don't see above warning in my build after apply this patch. ( Tested on linux-next tree ).

I found the problem now.
It is because the define of module_platform_driver does not exist in your mmc-next branch.
However, it does exist in your master branch. ( see include/linux/platform_device.h )

Axel