SATA/PATA: convert drivers/ata/* to use module_platform_driver()

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>
This commit is contained in:
Axel Lin 2011-11-27 14:44:26 +08:00 коммит произвёл Jeff Garzik
Родитель d63e94a442
Коммит 99c8ea3e57
12 изменённых файлов: 13 добавлений и 158 удалений

Просмотреть файл

@ -963,17 +963,7 @@ static struct platform_driver arasan_cf_driver = {
}, },
}; };
static int __init arasan_cf_init(void) module_platform_driver(arasan_cf_driver);
{
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_AUTHOR("Viresh Kumar <viresh.kumar@st.com>"); MODULE_AUTHOR("Viresh Kumar <viresh.kumar@st.com>");
MODULE_DESCRIPTION("Arasan ATA Compact Flash driver"); MODULE_DESCRIPTION("Arasan ATA Compact Flash driver");

Просмотреть файл

@ -454,20 +454,7 @@ static struct platform_driver pata_at91_driver = {
}, },
}; };
static int __init pata_at91_init(void) module_platform_driver(pata_at91_driver);
{
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_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Driver for CF in True IDE mode on AT91SAM9260 SoC"); MODULE_DESCRIPTION("Driver for CF in True IDE mode on AT91SAM9260 SoC");

Просмотреть файл

@ -235,17 +235,7 @@ static struct platform_driver pata_imx_driver = {
}, },
}; };
static int __init pata_imx_init(void) module_platform_driver(pata_imx_driver);
{
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_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>"); MODULE_AUTHOR("Arnaud Patard <arnaud.patard@rtp-net.org>");
MODULE_DESCRIPTION("low-level driver for iMX PATA"); MODULE_DESCRIPTION("low-level driver for iMX PATA");

Просмотреть файл

@ -205,21 +205,10 @@ static struct platform_driver ixp4xx_pata_platform_driver = {
.remove = __devexit_p(ixp4xx_pata_remove), .remove = __devexit_p(ixp4xx_pata_remove),
}; };
static int __init ixp4xx_pata_init(void) module_platform_driver(ixp4xx_pata_platform_driver);
{
return platform_driver_register(&ixp4xx_pata_platform_driver);
}
static void __exit ixp4xx_pata_exit(void)
{
platform_driver_unregister(&ixp4xx_pata_platform_driver);
}
MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>"); MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
MODULE_DESCRIPTION("low-level driver for ixp4xx Compact Flash PATA"); MODULE_DESCRIPTION("low-level driver for ixp4xx Compact Flash PATA");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
MODULE_ALIAS("platform:" DRV_NAME); MODULE_ALIAS("platform:" DRV_NAME);
module_init(ixp4xx_pata_init);
module_exit(ixp4xx_pata_exit);

Просмотреть файл

@ -897,26 +897,7 @@ static struct platform_driver mpc52xx_ata_of_platform_driver = {
}, },
}; };
module_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_AUTHOR("Sylvain Munaut <tnt@246tNt.com>"); MODULE_AUTHOR("Sylvain Munaut <tnt@246tNt.com>");
MODULE_DESCRIPTION("Freescale MPC52xx IDE/ATA libata driver"); MODULE_DESCRIPTION("Freescale MPC52xx IDE/ATA libata driver");

Просмотреть файл

@ -101,17 +101,7 @@ static struct platform_driver pata_of_platform_driver = {
.remove = __devexit_p(pata_of_platform_remove), .remove = __devexit_p(pata_of_platform_remove),
}; };
static int __init pata_of_platform_init(void) module_platform_driver(pata_of_platform_driver);
{
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_DESCRIPTION("OF-platform PATA driver"); MODULE_DESCRIPTION("OF-platform PATA driver");
MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>"); MODULE_AUTHOR("Anton Vorontsov <avorontsov@ru.mvista.com>");

Просмотреть файл

@ -132,20 +132,9 @@ static struct platform_driver palmld_pata_platform_driver = {
.remove = __devexit_p(palmld_pata_remove), .remove = __devexit_p(palmld_pata_remove),
}; };
static int __init palmld_pata_init(void) module_platform_driver(palmld_pata_platform_driver);
{
return platform_driver_register(&palmld_pata_platform_driver);
}
static void __exit palmld_pata_exit(void)
{
platform_driver_unregister(&palmld_pata_platform_driver);
}
MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
MODULE_DESCRIPTION("PalmLD PATA driver"); MODULE_DESCRIPTION("PalmLD PATA driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRV_NAME); MODULE_ALIAS("platform:" DRV_NAME);
module_init(palmld_pata_init);
module_exit(palmld_pata_exit);

Просмотреть файл

@ -256,17 +256,7 @@ static struct platform_driver pata_platform_driver = {
}, },
}; };
static int __init pata_platform_init(void) module_platform_driver(pata_platform_driver);
{
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_param(pio_mask, int, 0); module_param(pio_mask, int, 0);

Просмотреть файл

@ -390,18 +390,7 @@ static struct platform_driver pxa_ata_driver = {
}, },
}; };
static int __init pxa_ata_init(void) module_platform_driver(pxa_ata_driver);
{
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_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>");
MODULE_DESCRIPTION("DMA-capable driver for PATA on PXA CPU"); MODULE_DESCRIPTION("DMA-capable driver for PATA on PXA CPU");

Просмотреть файл

@ -188,9 +188,6 @@ static __devexit int rb532_pata_driver_remove(struct platform_device *pdev)
return 0; return 0;
} }
/* work with hotplug and coldplug */
MODULE_ALIAS("platform:" DRV_NAME);
static struct platform_driver rb532_pata_platform_driver = { static struct platform_driver rb532_pata_platform_driver = {
.probe = rb532_pata_driver_probe, .probe = rb532_pata_driver_probe,
.remove = __devexit_p(rb532_pata_driver_remove), .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 #define DRV_INFO DRV_DESC " version " DRV_VERSION
static int __init rb532_pata_module_init(void) module_platform_driver(rb532_pata_platform_driver);
{
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_AUTHOR("Gabor Juhos <juhosg at openwrt.org>"); MODULE_AUTHOR("Gabor Juhos <juhosg at openwrt.org>");
MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>"); MODULE_AUTHOR("Florian Fainelli <florian@openwrt.org>");
MODULE_DESCRIPTION(DRV_DESC); MODULE_DESCRIPTION(DRV_DESC);
MODULE_VERSION(DRV_VERSION); MODULE_VERSION(DRV_VERSION);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:" DRV_NAME);
module_init(rb532_pata_module_init);
module_exit(rb532_pata_module_exit);

Просмотреть файл

@ -1777,18 +1777,7 @@ static struct platform_driver sata_dwc_driver = {
.remove = sata_dwc_remove, .remove = sata_dwc_remove,
}; };
static int __init sata_dwc_init(void) module_platform_driver(sata_dwc_driver);
{
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_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Mark Miesfeld <mmiesfeld@amcc.com>"); MODULE_AUTHOR("Mark Miesfeld <mmiesfeld@amcc.com>");

Просмотреть файл

@ -1452,21 +1452,9 @@ static struct platform_driver fsl_sata_driver = {
#endif #endif
}; };
static int __init sata_fsl_init(void) module_platform_driver(fsl_sata_driver);
{
platform_driver_register(&fsl_sata_driver);
return 0;
}
static void __exit sata_fsl_exit(void)
{
platform_driver_unregister(&fsl_sata_driver);
}
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Ashish Kalra, Freescale Semiconductor"); MODULE_AUTHOR("Ashish Kalra, Freescale Semiconductor");
MODULE_DESCRIPTION("Freescale 3.0Gbps SATA controller low level driver"); MODULE_DESCRIPTION("Freescale 3.0Gbps SATA controller low level driver");
MODULE_VERSION("1.10"); MODULE_VERSION("1.10");
module_init(sata_fsl_init);
module_exit(sata_fsl_exit);