Skip to content

Commit

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

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
  • Loading branch information
Axel Lin authored and Stefan Richter committed Apr 9, 2012
1 parent 0034102 commit fe2af11
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 29 deletions.
20 changes: 4 additions & 16 deletions drivers/firewire/nosy.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,29 +693,17 @@ static struct pci_device_id pci_table[] __devinitdata = {
{ } /* Terminating entry */
};

MODULE_DEVICE_TABLE(pci, pci_table);

static struct pci_driver lynx_pci_driver = {
.name = driver_name,
.id_table = pci_table,
.probe = add_card,
.remove = remove_card,
};

module_pci_driver(lynx_pci_driver);

MODULE_AUTHOR("Kristian Hoegsberg");
MODULE_DESCRIPTION("Snoop mode driver for TI pcilynx 1394 controllers");
MODULE_LICENSE("GPL");
MODULE_DEVICE_TABLE(pci, pci_table);

static int __init nosy_init(void)
{
return pci_register_driver(&lynx_pci_driver);
}

static void __exit nosy_cleanup(void)
{
pci_unregister_driver(&lynx_pci_driver);

pr_info("Unloaded %s\n", driver_name);
}

module_init(nosy_init);
module_exit(nosy_cleanup);
15 changes: 2 additions & 13 deletions drivers/firewire/ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -3789,6 +3789,8 @@ static struct pci_driver fw_ohci_pci_driver = {
#endif
};

module_pci_driver(fw_ohci_pci_driver);

MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
MODULE_DESCRIPTION("Driver for PCI OHCI IEEE1394 controllers");
MODULE_LICENSE("GPL");
Expand All @@ -3797,16 +3799,3 @@ MODULE_LICENSE("GPL");
#ifndef CONFIG_IEEE1394_OHCI1394_MODULE
MODULE_ALIAS("ohci1394");
#endif

static int __init fw_ohci_init(void)
{
return pci_register_driver(&fw_ohci_pci_driver);
}

static void __exit fw_ohci_cleanup(void)
{
pci_unregister_driver(&fw_ohci_pci_driver);
}

module_init(fw_ohci_init);
module_exit(fw_ohci_cleanup);

0 comments on commit fe2af11

Please sign in to comment.