Skip to content

Commit

Permalink
ata: use module_pci_driver
Browse files Browse the repository at this point in the history
This patch converts the drivers in drivers/ata/* to use module_pci_driver()
macro which makes the code smaller and a bit simpler.

Signed-off-by: Axel Lin <[email protected]>
Cc: Alan Cox <[email protected]>
Cc: Jeff Garzik <[email protected]>
Cc: Mikael Pettersson <[email protected]>
Cc: Mark Lord <[email protected]>
Cc: Jeremy Higdon <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Signed-off-by: Jeff Garzik <[email protected]>
  • Loading branch information
AxelLin authored and Jeff Garzik committed Jul 25, 2012
1 parent b08f5bc commit 2fc75da
Show file tree
Hide file tree
Showing 60 changed files with 60 additions and 761 deletions.
13 changes: 1 addition & 12 deletions drivers/ata/acard-ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,21 +503,10 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id
&acard_ahci_sht);
}

static int __init acard_ahci_init(void)
{
return pci_register_driver(&acard_ahci_pci_driver);
}

static void __exit acard_ahci_exit(void)
{
pci_unregister_driver(&acard_ahci_pci_driver);
}
module_pci_driver(acard_ahci_pci_driver);

MODULE_AUTHOR("Jeff Garzik");
MODULE_DESCRIPTION("ACard AHCI SATA low-level driver");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, acard_ahci_pci_tbl);
MODULE_VERSION(DRV_VERSION);

module_init(acard_ahci_init);
module_exit(acard_ahci_exit);
14 changes: 1 addition & 13 deletions drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,22 +1249,10 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
&ahci_sht);
}

static int __init ahci_init(void)
{
return pci_register_driver(&ahci_pci_driver);
}

static void __exit ahci_exit(void)
{
pci_unregister_driver(&ahci_pci_driver);
}

module_pci_driver(ahci_pci_driver);

MODULE_AUTHOR("Jeff Garzik");
MODULE_DESCRIPTION("AHCI SATA low-level driver");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, ahci_pci_tbl);
MODULE_VERSION(DRV_VERSION);

module_init(ahci_init);
module_exit(ahci_exit);
15 changes: 1 addition & 14 deletions drivers/ata/ata_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,25 +255,12 @@ static struct pci_driver ata_generic_pci_driver = {
#endif
};

static int __init ata_generic_init(void)
{
return pci_register_driver(&ata_generic_pci_driver);
}


static void __exit ata_generic_exit(void)
{
pci_unregister_driver(&ata_generic_pci_driver);
}

module_pci_driver(ata_generic_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for generic ATA");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, ata_generic);
MODULE_VERSION(DRV_VERSION);

module_init(ata_generic_init);
module_exit(ata_generic_exit);

module_param(all_generic_ide, int, 0);
14 changes: 1 addition & 13 deletions drivers/ata/pata_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,22 +273,10 @@ static struct pci_driver pacpi_pci_driver = {
#endif
};

static int __init pacpi_init(void)
{
return pci_register_driver(&pacpi_pci_driver);
}

static void __exit pacpi_exit(void)
{
pci_unregister_driver(&pacpi_pci_driver);
}

module_init(pacpi_init);
module_exit(pacpi_exit);
module_pci_driver(pacpi_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("SCSI low-level driver for ATA in ACPI mode");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, pacpi_pci_tbl);
MODULE_VERSION(DRV_VERSION);

13 changes: 1 addition & 12 deletions drivers/ata/pata_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,21 +632,10 @@ static struct pci_driver amd_pci_driver = {
#endif
};

static int __init amd_init(void)
{
return pci_register_driver(&amd_pci_driver);
}

static void __exit amd_exit(void)
{
pci_unregister_driver(&amd_pci_driver);
}
module_pci_driver(amd_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for AMD and Nvidia PATA IDE");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, amd);
MODULE_VERSION(DRV_VERSION);

module_init(amd_init);
module_exit(amd_exit);
13 changes: 1 addition & 12 deletions drivers/ata/pata_artop.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,18 +451,7 @@ static struct pci_driver artop_pci_driver = {
#endif
};

static int __init artop_init(void)
{
return pci_register_driver(&artop_pci_driver);
}

static void __exit artop_exit(void)
{
pci_unregister_driver(&artop_pci_driver);
}

module_init(artop_init);
module_exit(artop_exit);
module_pci_driver(artop_pci_driver);

MODULE_AUTHOR("Alan Cox, Bartlomiej Zolnierkiewicz");
MODULE_DESCRIPTION("SCSI low-level driver for ARTOP PATA");
Expand Down
14 changes: 1 addition & 13 deletions drivers/ata/pata_atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,22 +289,10 @@ static struct pci_driver atiixp_pci_driver = {
#endif
};

static int __init atiixp_init(void)
{
return pci_register_driver(&atiixp_pci_driver);
}


static void __exit atiixp_exit(void)
{
pci_unregister_driver(&atiixp_pci_driver);
}
module_pci_driver(atiixp_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for ATI IXP200/300/400");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, atiixp);
MODULE_VERSION(DRV_VERSION);

module_init(atiixp_init);
module_exit(atiixp_exit);
13 changes: 1 addition & 12 deletions drivers/ata/pata_atp867x.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,21 +565,10 @@ static struct pci_driver atp867x_driver = {
#endif
};

static int __init atp867x_init(void)
{
return pci_register_driver(&atp867x_driver);
}

static void __exit atp867x_exit(void)
{
pci_unregister_driver(&atp867x_driver);
}
module_pci_driver(atp867x_driver);

MODULE_AUTHOR("John(Jung-Ik) Lee, Google Inc.");
MODULE_DESCRIPTION("low level driver for Artop/Acard 867x ATA controller");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, atp867x_pci_tbl);
MODULE_VERSION(DRV_VERSION);

module_init(atp867x_init);
module_exit(atp867x_exit);
13 changes: 1 addition & 12 deletions drivers/ata/pata_cmd640.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,10 @@ static struct pci_driver cmd640_pci_driver = {
#endif
};

static int __init cmd640_init(void)
{
return pci_register_driver(&cmd640_pci_driver);
}

static void __exit cmd640_exit(void)
{
pci_unregister_driver(&cmd640_pci_driver);
}
module_pci_driver(cmd640_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for CMD640 PATA controllers");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, cmd640);
MODULE_VERSION(DRV_VERSION);

module_init(cmd640_init);
module_exit(cmd640_exit);
13 changes: 1 addition & 12 deletions drivers/ata/pata_cmd64x.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,21 +525,10 @@ static struct pci_driver cmd64x_pci_driver = {
#endif
};

static int __init cmd64x_init(void)
{
return pci_register_driver(&cmd64x_pci_driver);
}

static void __exit cmd64x_exit(void)
{
pci_unregister_driver(&cmd64x_pci_driver);
}
module_pci_driver(cmd64x_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for CMD64x series PATA controllers");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, cmd64x);
MODULE_VERSION(DRV_VERSION);

module_init(cmd64x_init);
module_exit(cmd64x_exit);
14 changes: 1 addition & 13 deletions drivers/ata/pata_cs5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -302,22 +302,10 @@ static struct pci_driver cs5520_pci_driver = {
#endif
};

static int __init cs5520_init(void)
{
return pci_register_driver(&cs5520_pci_driver);
}

static void __exit cs5520_exit(void)
{
pci_unregister_driver(&cs5520_pci_driver);
}
module_pci_driver(cs5520_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for Cyrix CS5510/5520");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, pata_cs5520);
MODULE_VERSION(DRV_VERSION);

module_init(cs5520_init);
module_exit(cs5520_exit);

13 changes: 1 addition & 12 deletions drivers/ata/pata_cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,21 +363,10 @@ static struct pci_driver cs5530_pci_driver = {
#endif
};

static int __init cs5530_init(void)
{
return pci_register_driver(&cs5530_pci_driver);
}

static void __exit cs5530_exit(void)
{
pci_unregister_driver(&cs5530_pci_driver);
}
module_pci_driver(cs5530_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for the Cyrix/NS/AMD 5530");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, cs5530);
MODULE_VERSION(DRV_VERSION);

module_init(cs5530_init);
module_exit(cs5530_exit);
13 changes: 1 addition & 12 deletions drivers/ata/pata_cs5535.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,21 +207,10 @@ static struct pci_driver cs5535_pci_driver = {
#endif
};

static int __init cs5535_init(void)
{
return pci_register_driver(&cs5535_pci_driver);
}

static void __exit cs5535_exit(void)
{
pci_unregister_driver(&cs5535_pci_driver);
}
module_pci_driver(cs5535_pci_driver);

MODULE_AUTHOR("Alan Cox, Jens Altmann, Wolfgan Zuleger, Alexander Kiausch");
MODULE_DESCRIPTION("low-level driver for the NS/AMD 5535");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, cs5535);
MODULE_VERSION(DRV_VERSION);

module_init(cs5535_init);
module_exit(cs5535_exit);
13 changes: 1 addition & 12 deletions drivers/ata/pata_cs5536.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,21 +274,10 @@ static struct pci_driver cs5536_pci_driver = {
#endif
};

static int __init cs5536_init(void)
{
return pci_register_driver(&cs5536_pci_driver);
}

static void __exit cs5536_exit(void)
{
pci_unregister_driver(&cs5536_pci_driver);
}
module_pci_driver(cs5536_pci_driver);

MODULE_AUTHOR("Martin K. Petersen");
MODULE_DESCRIPTION("low-level driver for the CS5536 IDE controller");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, cs5536);
MODULE_VERSION(DRV_VERSION);

module_init(cs5536_init);
module_exit(cs5536_exit);
15 changes: 1 addition & 14 deletions drivers/ata/pata_cypress.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,23 +158,10 @@ static struct pci_driver cy82c693_pci_driver = {
#endif
};

static int __init cy82c693_init(void)
{
return pci_register_driver(&cy82c693_pci_driver);
}


static void __exit cy82c693_exit(void)
{
pci_unregister_driver(&cy82c693_pci_driver);
}

module_pci_driver(cy82c693_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for the CY82C693 PATA controller");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, cy82c693);
MODULE_VERSION(DRV_VERSION);

module_init(cy82c693_init);
module_exit(cy82c693_exit);
14 changes: 1 addition & 13 deletions drivers/ata/pata_efar.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,22 +295,10 @@ static struct pci_driver efar_pci_driver = {
#endif
};

static int __init efar_init(void)
{
return pci_register_driver(&efar_pci_driver);
}

static void __exit efar_exit(void)
{
pci_unregister_driver(&efar_pci_driver);
}

module_init(efar_init);
module_exit(efar_exit);
module_pci_driver(efar_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("SCSI low-level driver for EFAR PIIX clones");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, efar_pci_tbl);
MODULE_VERSION(DRV_VERSION);

13 changes: 1 addition & 12 deletions drivers/ata/pata_hpt366.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,21 +418,10 @@ static struct pci_driver hpt36x_pci_driver = {
#endif
};

static int __init hpt36x_init(void)
{
return pci_register_driver(&hpt36x_pci_driver);
}

static void __exit hpt36x_exit(void)
{
pci_unregister_driver(&hpt36x_pci_driver);
}
module_pci_driver(hpt36x_pci_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for the Highpoint HPT366/368");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, hpt36x);
MODULE_VERSION(DRV_VERSION);

module_init(hpt36x_init);
module_exit(hpt36x_exit);
Loading

0 comments on commit 2fc75da

Please sign in to comment.