Skip to content

Commit fe2af11

Browse files
AxelLinStefan Richter
authored and
Stefan Richter
committed
firewire: use module_pci_driver
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>
1 parent 0034102 commit fe2af11

File tree

2 files changed

+6
-29
lines changed

2 files changed

+6
-29
lines changed

drivers/firewire/nosy.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -693,29 +693,17 @@ static struct pci_device_id pci_table[] __devinitdata = {
693693
{ } /* Terminating entry */
694694
};
695695

696+
MODULE_DEVICE_TABLE(pci, pci_table);
697+
696698
static struct pci_driver lynx_pci_driver = {
697699
.name = driver_name,
698700
.id_table = pci_table,
699701
.probe = add_card,
700702
.remove = remove_card,
701703
};
702704

705+
module_pci_driver(lynx_pci_driver);
706+
703707
MODULE_AUTHOR("Kristian Hoegsberg");
704708
MODULE_DESCRIPTION("Snoop mode driver for TI pcilynx 1394 controllers");
705709
MODULE_LICENSE("GPL");
706-
MODULE_DEVICE_TABLE(pci, pci_table);
707-
708-
static int __init nosy_init(void)
709-
{
710-
return pci_register_driver(&lynx_pci_driver);
711-
}
712-
713-
static void __exit nosy_cleanup(void)
714-
{
715-
pci_unregister_driver(&lynx_pci_driver);
716-
717-
pr_info("Unloaded %s\n", driver_name);
718-
}
719-
720-
module_init(nosy_init);
721-
module_exit(nosy_cleanup);

drivers/firewire/ohci.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3789,6 +3789,8 @@ static struct pci_driver fw_ohci_pci_driver = {
37893789
#endif
37903790
};
37913791

3792+
module_pci_driver(fw_ohci_pci_driver);
3793+
37923794
MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>");
37933795
MODULE_DESCRIPTION("Driver for PCI OHCI IEEE1394 controllers");
37943796
MODULE_LICENSE("GPL");
@@ -3797,16 +3799,3 @@ MODULE_LICENSE("GPL");
37973799
#ifndef CONFIG_IEEE1394_OHCI1394_MODULE
37983800
MODULE_ALIAS("ohci1394");
37993801
#endif
3800-
3801-
static int __init fw_ohci_init(void)
3802-
{
3803-
return pci_register_driver(&fw_ohci_pci_driver);
3804-
}
3805-
3806-
static void __exit fw_ohci_cleanup(void)
3807-
{
3808-
pci_unregister_driver(&fw_ohci_pci_driver);
3809-
}
3810-
3811-
module_init(fw_ohci_init);
3812-
module_exit(fw_ohci_cleanup);

0 commit comments

Comments
 (0)