Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Axel Lin and committed by
Stefan Richter
fe2af11c 00341028

+6 -29
+4 -16
drivers/firewire/nosy.c
··· 693 693 { } /* Terminating entry */ 694 694 }; 695 695 696 + MODULE_DEVICE_TABLE(pci, pci_table); 697 + 696 698 static struct pci_driver lynx_pci_driver = { 697 699 .name = driver_name, 698 700 .id_table = pci_table, ··· 702 700 .remove = remove_card, 703 701 }; 704 702 703 + module_pci_driver(lynx_pci_driver); 704 + 705 705 MODULE_AUTHOR("Kristian Hoegsberg"); 706 706 MODULE_DESCRIPTION("Snoop mode driver for TI pcilynx 1394 controllers"); 707 707 MODULE_LICENSE("GPL"); 708 - MODULE_DEVICE_TABLE(pci, pci_table); 709 - 710 - static int __init nosy_init(void) 711 - { 712 - return pci_register_driver(&lynx_pci_driver); 713 - } 714 - 715 - static void __exit nosy_cleanup(void) 716 - { 717 - pci_unregister_driver(&lynx_pci_driver); 718 - 719 - pr_info("Unloaded %s\n", driver_name); 720 - } 721 - 722 - module_init(nosy_init); 723 - module_exit(nosy_cleanup);
+2 -13
drivers/firewire/ohci.c
··· 3789 3789 #endif 3790 3790 }; 3791 3791 3792 + module_pci_driver(fw_ohci_pci_driver); 3793 + 3792 3794 MODULE_AUTHOR("Kristian Hoegsberg <krh@bitplanet.net>"); 3793 3795 MODULE_DESCRIPTION("Driver for PCI OHCI IEEE1394 controllers"); 3794 3796 MODULE_LICENSE("GPL"); ··· 3799 3797 #ifndef CONFIG_IEEE1394_OHCI1394_MODULE 3800 3798 MODULE_ALIAS("ohci1394"); 3801 3799 #endif 3802 - 3803 - static int __init fw_ohci_init(void) 3804 - { 3805 - return pci_register_driver(&fw_ohci_pci_driver); 3806 - } 3807 - 3808 - static void __exit fw_ohci_cleanup(void) 3809 - { 3810 - pci_unregister_driver(&fw_ohci_pci_driver); 3811 - } 3812 - 3813 - module_init(fw_ohci_init); 3814 - module_exit(fw_ohci_cleanup);