SATA/PATA: convert drivers/ata/* to use module_platform_driver()
authorAxel Lin <axel.lin@gmail.com>
Sun, 27 Nov 2011 06:44:26 +0000 (14:44 +0800)
committerJeff Garzik <jgarzik@redhat.com>
Mon, 9 Jan 2012 00:14:58 +0000 (19:14 -0500)
This patch converts the drivers in drivers/ata/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.

Cc: Viresh Kumar <viresh.kumar@st.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Cc: Arnaud Patard <arnaud.patard@rtp-net.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Sylvain Munaut <tnt@246tNt.com>
Cc: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Florian Fainelli <florian@openwrt.org>
Cc: Mark Miesfeld <mmiesfeld@amcc.com>
Cc: Ashish Kalra <ashish.kalra@freescale.com>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
12 files changed:
drivers/ata/pata_arasan_cf.c
drivers/ata/pata_at91.c
drivers/ata/pata_imx.c
drivers/ata/pata_ixp4xx_cf.c
drivers/ata/pata_mpc52xx.c
drivers/ata/pata_of_platform.c
drivers/ata/pata_palmld.c
drivers/ata/pata_platform.c
drivers/ata/pata_pxa.c
drivers/ata/pata_rb532_cf.c
drivers/ata/sata_dwc_460ex.c
drivers/ata/sata_fsl.c

index e8574bba3ee4821daaadf3db70ee8402f6cd2cfd..048589fad2ca203ef529e7897a2d9d0e2bc858d5 100644 (file)
@@ -963,17 +963,7 @@ static struct platform_driver arasan_cf_driver = {
        },
 };
 
-static int __init arasan_cf_init(void)
-{
-       return platform_driver_register(&arasan_cf_driver);
-}
-module_init(arasan_cf_init);
-
-static void __exit arasan_cf_exit(void)
-{
-       platform_driver_unregister(&arasan_cf_driver);
-}
-module_exit(arasan_cf_exit);
+module_platform_driver(arasan_cf_driver);
 
 MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>");
 MODULE_DESCRIPTION("Arasan ATA Compact Flash driver");
index a76f24a8e5db95a98b3f9dda9ecfc7dcab3eb4ce..d56dd45adf2f2be888374d46f6d0889267fcb513 100644 (file)
@@ -454,20 +454,7 @@ static struct platform_driver pata_at91_driver = {
        },
 };
 
-static int __init pata_at91_init(void)
-{
-       return platform_driver_register(&pata_at91_driver);
-}
-
-static void __exit pata_at91_exit(void)
-{
-       platform_driver_unregister(&pata_at91_driver);
-}
-
-
-module_init(pata_at91_init);
-module_exit(pata_at91_exit);
-
+module_platform_driver(pata_at91_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Driver for CF in True IDE mode on AT91SAM9260 SoC");
index ca9d9caedfa3137fd32e287cce52f05ae70d8bee..c5af97f5107b5af2790b174aa219e7e176879321 100644 (file)
@@ -235,17 +235,7 @@ static struct platform_driver pata_imx_driver = {
        },
 };
 
-static int __init pata_imx_init(void)
-{
-       return platform_driver_register(&pata_imx_driver);
-}
-
-static void __exit pata_imx_exit(void)
-{
-       platform_driver_unregister(&pata_imx_driver);
-}
-module_init(pata_imx_init);
-module_exit(pata_imx_exit);
+module_platform_driver(pata_imx_driver);
 
 MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
 MODULE_DESCRIPTION("low-level driver for iMX PATA");
index 15b64311fe0a8bdf7423e33169d5eaff9833a46a..badb1789a918a21c027ee0d5b0b0610eb7bd2340 100644 (file)
@@ -205,21 +205,10 @@ static struct platform_driver ixp4xx_pata_platform_driver = {
        .remove         = __devexit_p(ixp4xx_pata_remove),
 };
 
-static int __init ixp4xx_pata_init(void)
-{
-       return platform_driver_register(&ixp4xx_pata_platform_driver);
-}
-
-static void __exit ixp4xx_pata_exit(void)
-{
-       platform_driver_unregister(&ixp4xx_pata_platform_driver);
-}
+module_platform_driver(ixp4xx_pata_platform_driver);
 
 MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
 MODULE_DESCRIPTION("low-level driver for ixp4xx Compact Flash PATA");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_VERSION);
 MODULE_ALIAS("platform:" DRV_NAME);
-
-module_init(ixp4xx_pata_init);
-module_exit(ixp4xx_pata_exit);
index 3e1746314f220b6747a929cd353e18dea24db91a..00748ae1a016ec9eaf55f93b36a1142fcb73c028 100644 (file)
@@ -897,26 +897,7 @@ static struct platform_driver mpc52xx_ata_of_platform_driver = {
        },
 };
 
-
-/* ======================================================================== */
-/* Module                                                                   */
-/* ======================================================================== */
-
-static int __init
-mpc52xx_ata_init(void)
-{
-       printk(KERN_INFO "ata: MPC52xx IDE/ATA libata driver\n");
-       return platform_driver_register(&mpc52xx_ata_of_platform_driver);
-}
-
-static void __exit
-mpc52xx_ata_exit(void)
-{
-       platform_driver_unregister(&mpc52xx_ata_of_platform_driver);
-}
-
-module_init(mpc52xx_ata_init);
-module_exit(mpc52xx_ata_exit);
+module_platform_driver(mpc52xx_ata_of_platform_driver);
 
 MODULE_AUTHOR("Sylvain Munaut <tnt@246tNt.com>");
 MODULE_DESCRIPTION("Freescale MPC52xx IDE/ATA libata driver");
index 2a472c5bb7db7015d76118434a8d50e7795a07d1..9f11c35418c4051cf9e26a31b3def343c8bdc783 100644 (file)
@@ -101,17 +101,7 @@ static struct platform_driver pata_of_platform_driver = {
        .remove         = __devexit_p(pata_of_platform_remove),
 };
 
-static int __init pata_of_platform_init(void)
-{
-       return platform_driver_register(&pata_of_platform_driver);
-}
-module_init(pata_of_platform_init);
-
-static void __exit pata_of_platform_exit(void)
-{
-       platform_driver_unregister(&pata_of_platform_driver);
-}
-module_exit(pata_of_platform_exit);
+module_platform_driver(pata_of_platform_driver);
 
 MODULE_DESCRIPTION("OF-platform PATA driver");
 MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");
index b86d7e22595e6bd511c004e0aaf517b26a1bcf93..5ff31b68135c5c9a01c2b3166ff7f3cfb1a5cd71 100644 (file)
@@ -132,20 +132,9 @@ static struct platform_driver palmld_pata_platform_driver = {
        .remove         = __devexit_p(palmld_pata_remove),
 };
 
-static int __init palmld_pata_init(void)
-{
-       return platform_driver_register(&palmld_pata_platform_driver);
-}
-
-static void __exit palmld_pata_exit(void)
-{
-       platform_driver_unregister(&palmld_pata_platform_driver);
-}
+module_platform_driver(palmld_pata_platform_driver);
 
 MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
 MODULE_DESCRIPTION("PalmLD PATA driver");
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:" DRV_NAME);
-
-module_init(palmld_pata_init);
-module_exit(palmld_pata_exit);
index 2067308f683f65864a79926acfedca11195541b9..f1848aeda78398a5994428719d63aefa207afaa7 100644 (file)
@@ -256,17 +256,7 @@ static struct platform_driver pata_platform_driver = {
        },
 };
 
-static int __init pata_platform_init(void)
-{
-       return platform_driver_register(&pata_platform_driver);
-}
-
-static void __exit pata_platform_exit(void)
-{
-       platform_driver_unregister(&pata_platform_driver);
-}
-module_init(pata_platform_init);
-module_exit(pata_platform_exit);
+module_platform_driver(pata_platform_driver);
 
 module_param(pio_mask, int, 0);
 
index b4ede40f8ae15189c20300dd585e8045e54efb6c..0bb0fb7b26bc345ce84304461cf0185e5a4d5f32 100644 (file)
@@ -390,18 +390,7 @@ static struct platform_driver pxa_ata_driver = {
        },
 };
 
-static int __init pxa_ata_init(void)
-{
-       return platform_driver_register(&pxa_ata_driver);
-}
-
-static void __exit pxa_ata_exit(void)
-{
-       platform_driver_unregister(&pxa_ata_driver);
-}
-
-module_init(pxa_ata_init);
-module_exit(pxa_ata_exit);
+module_platform_driver(pxa_ata_driver);
 
 MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
 MODULE_DESCRIPTION("DMA-capable driver for PATA on PXA CPU");
index 1b9d10d9c5d912b8306b9cd73d30e5d521cfd6a7..9417101bd5ca4524eb4aefdd797e4f41fc6840ae 100644 (file)
@@ -188,9 +188,6 @@ static __devexit int rb532_pata_driver_remove(struct platform_device *pdev)
        return 0;
 }
 
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:" DRV_NAME);
-
 static struct platform_driver rb532_pata_platform_driver = {
        .probe          = rb532_pata_driver_probe,
        .remove         = __devexit_p(rb532_pata_driver_remove),
@@ -200,27 +197,13 @@ static struct platform_driver rb532_pata_platform_driver = {
        },
 };
 
-/* ------------------------------------------------------------------------ */
-
 #define DRV_INFO DRV_DESC " version " DRV_VERSION
 
-static int __init rb532_pata_module_init(void)
-{
-       printk(KERN_INFO DRV_INFO "\n");
-
-       return platform_driver_register(&rb532_pata_platform_driver);
-}
-
-static void __exit rb532_pata_module_exit(void)
-{
-       platform_driver_unregister(&rb532_pata_platform_driver);
-}
+module_platform_driver(rb532_pata_platform_driver);
 
 MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>");
 MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
 MODULE_DESCRIPTION(DRV_DESC);
 MODULE_VERSION(DRV_VERSION);
 MODULE_LICENSE("GPL");
-
-module_init(rb532_pata_module_init);
-module_exit(rb532_pata_module_exit);
+MODULE_ALIAS("platform:" DRV_NAME);
index 5c4237452f5072a97a82eca00e95d55c15ce2542..69f7cde49c6b987a4fb263f9d28d5d49169c8ff6 100644 (file)
@@ -1777,18 +1777,7 @@ static struct platform_driver sata_dwc_driver = {
        .remove = sata_dwc_remove,
 };
 
-static int __init sata_dwc_init(void)
-{
-       return platform_driver_register(&sata_dwc_driver);
-}
-
-static void __exit sata_dwc_exit(void)
-{
-       platform_driver_unregister(&sata_dwc_driver);
-}
-
-module_init(sata_dwc_init);
-module_exit(sata_dwc_exit);
+module_platform_driver(sata_dwc_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Mark Miesfeld <mmiesfeld@amcc.com>");
index 78ae7b67b09e7bdf79823fece7aa9fef0d01b720..5a2c95ba050a28caacbb4e3a799a0cdd176fcf47 100644 (file)
@@ -1452,21 +1452,9 @@ static struct platform_driver fsl_sata_driver = {
 #endif
 };
 
-static int __init sata_fsl_init(void)
-{
-       platform_driver_register(&fsl_sata_driver);
-       return 0;
-}
-
-static void __exit sata_fsl_exit(void)
-{
-       platform_driver_unregister(&fsl_sata_driver);
-}
+module_platform_driver(fsl_sata_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Ashish Kalra, Freescale Semiconductor");
 MODULE_DESCRIPTION("Freescale 3.0Gbps SATA controller low level driver");
 MODULE_VERSION("1.10");
-
-module_init(sata_fsl_init);
-module_exit(sata_fsl_exit);