Commit 4d16cd65 authored by Axel Lin's avatar Axel Lin Committed by David Woodhouse

mtd: use module_pci_driver

This patch converts the drivers in drivers/mtd/* to use module_pci_driver()
macro which makes the code smaller and a bit simpler.
Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 4aa6ae3e
...@@ -260,18 +260,7 @@ static struct pci_driver vr_nor_pci_driver = { ...@@ -260,18 +260,7 @@ static struct pci_driver vr_nor_pci_driver = {
.id_table = vr_nor_pci_ids, .id_table = vr_nor_pci_ids,
}; };
static int __init vr_nor_mtd_init(void) module_pci_driver(vr_nor_pci_driver);
{
return pci_register_driver(&vr_nor_pci_driver);
}
static void __exit vr_nor_mtd_exit(void)
{
pci_unregister_driver(&vr_nor_pci_driver);
}
module_init(vr_nor_mtd_init);
module_exit(vr_nor_mtd_exit);
MODULE_AUTHOR("Andy Lowe"); MODULE_AUTHOR("Andy Lowe");
MODULE_DESCRIPTION("MTD map driver for NOR flash on Intel Vermilion Range"); MODULE_DESCRIPTION("MTD map driver for NOR flash on Intel Vermilion Range");
......
...@@ -352,18 +352,7 @@ static struct pci_driver mtd_pci_driver = { ...@@ -352,18 +352,7 @@ static struct pci_driver mtd_pci_driver = {
.id_table = mtd_pci_ids, .id_table = mtd_pci_ids,
}; };
static int __init mtd_pci_maps_init(void) module_pci_driver(mtd_pci_driver);
{
return pci_register_driver(&mtd_pci_driver);
}
static void __exit mtd_pci_maps_exit(void)
{
pci_unregister_driver(&mtd_pci_driver);
}
module_init(mtd_pci_maps_init);
module_exit(mtd_pci_maps_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>"); MODULE_AUTHOR("Russell King <rmk@arm.linux.org.uk>");
......
...@@ -234,20 +234,7 @@ static struct pci_driver scb2_flash_driver = { ...@@ -234,20 +234,7 @@ static struct pci_driver scb2_flash_driver = {
.remove = __devexit_p(scb2_flash_remove), .remove = __devexit_p(scb2_flash_remove),
}; };
static int __init module_pci_driver(scb2_flash_driver);
scb2_flash_init(void)
{
return pci_register_driver(&scb2_flash_driver);
}
static void __exit
scb2_flash_exit(void)
{
pci_unregister_driver(&scb2_flash_driver);
}
module_init(scb2_flash_init);
module_exit(scb2_flash_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Tim Hockin <thockin@sun.com>"); MODULE_AUTHOR("Tim Hockin <thockin@sun.com>");
......
...@@ -888,17 +888,7 @@ static struct pci_driver cafe_nand_pci_driver = { ...@@ -888,17 +888,7 @@ static struct pci_driver cafe_nand_pci_driver = {
.resume = cafe_nand_resume, .resume = cafe_nand_resume,
}; };
static int __init cafe_nand_init(void) module_pci_driver(cafe_nand_pci_driver);
{
return pci_register_driver(&cafe_nand_pci_driver);
}
static void __exit cafe_nand_exit(void)
{
pci_unregister_driver(&cafe_nand_pci_driver);
}
module_init(cafe_nand_init);
module_exit(cafe_nand_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>"); MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
......
...@@ -1702,17 +1702,4 @@ static struct pci_driver denali_pci_driver = { ...@@ -1702,17 +1702,4 @@ static struct pci_driver denali_pci_driver = {
.remove = denali_pci_remove, .remove = denali_pci_remove,
}; };
static int __devinit denali_init(void) module_pci_driver(denali_pci_driver);
{
printk(KERN_INFO "Spectra MTD driver\n");
return pci_register_driver(&denali_pci_driver);
}
/* Free memory */
static void __devexit denali_exit(void)
{
pci_unregister_driver(&denali_pci_driver);
}
module_init(denali_init);
module_exit(denali_exit);
...@@ -1104,18 +1104,7 @@ static struct pci_driver r852_pci_driver = { ...@@ -1104,18 +1104,7 @@ static struct pci_driver r852_pci_driver = {
.driver.pm = &r852_pm_ops, .driver.pm = &r852_pm_ops,
}; };
static __init int r852_module_init(void) module_pci_driver(r852_pci_driver);
{
return pci_register_driver(&r852_pci_driver);
}
static void __exit r852_module_exit(void)
{
pci_unregister_driver(&r852_pci_driver);
}
module_init(r852_module_init);
module_exit(r852_module_exit);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_AUTHOR("Maxim Levitsky <maximlevitsky@gmail.com>"); MODULE_AUTHOR("Maxim Levitsky <maximlevitsky@gmail.com>");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment