usb: gadget: use module_pci_driver
PATCH 1/1 usb: gadget: use module_pci_driver
This patch converts the drivers in drivers/usb/gadget/* to use module_pci_driver() macro which makes the code smaller and a bit simpler.
Signed-off-by Axel Lin <[email protected]>
Cc Thomas Dahlmann <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Xiaochen Shen <[email protected]>
Cc Pavankumar Kondeti <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
--- drivers/usb/gadget/amd5536udc.c | 14 +------------- drivers/usb/gadget/ci13xxx_pci.c | 22 +--------------------- drivers/usb/gadget/goku_udc.c | 12 +----------- drivers/usb/gadget/langwell_udc.c | 16 +--------------- drivers/usb/gadget/pch_udc.c | 13 +------------ 5 files changed, 5 insertions(+), 72 deletions(-)
drivers/usb/gadget/amd5536udc.c +1 -13
@@ -3402,19 +3402,7 @@ static struct pci_driver udc_pci_driver = { .remove = udc_pci_remove, }; -/* Inits driver */ -static int __init init (void ) -{ -return pci_register_driver (&udc_pci_driver); -} -module_init (init); - -/* Cleans driver */ -static void __exit cleanup(void) -{ -pci_unregister_driver (&udc_pci_driver); -} -module_exit (cleanup); +module_pci_driver (udc_pci_driver);MODULE_DESCRIPTION (UDC_MOD_DESCRIPTION );MODULE_AUTHOR ("Thomas Dahlmann" );
drivers/usb/gadget/ci13xxx_pci.c +1 -21
@@ -148,27 +148,7 @@ static struct pci_driver ci13xxx_pci_driver = { .remove = __devexit_p(ci13xxx_pci_remove), }; -/** -* ci13xxx_pci_init: module init -* -* Driver load -*/ -static int __init ci13xxx_pci_init (void ) -{ -return pci_register_driver (&ci13xxx_pci_driver); -} -module_init (ci13xxx_pci_init); - -/** -* ci13xxx_pci_exit: module exit -* -* Driver unload -*/ -static void __exit ci13xxx_pci_exit(void) -{ -pci_unregister_driver (&ci13xxx_pci_driver); -} -module_exit (ci13xxx_pci_exit); +module_pci_driver (ci13xxx_pci_driver);MODULE_AUTHOR ("MIPS - David Lopo <[email protected]>" );MODULE_DESCRIPTION ("MIPS CI13XXX USB Peripheral Controller" );
drivers/usb/gadget/goku_udc.c +1 -11
@@ -1895,14 +1895,4 @@ static struct pci_driver goku_pci_driver = {/* FIXME add power management support */ }; -static int __init init (void ) -{ -return pci_register_driver (&goku_pci_driver); -} -module_init (init); - -static void __exit cleanup (void) -{ -pci_unregister_driver (&goku_pci_driver); -} -module_exit (cleanup); +module_pci_driver (goku_pci_driver);
drivers/usb/gadget/langwell_udc.c +1 -15
@@ -3412,23 +3412,9 @@ static struct pci_driver langwell_pci_driver = { .shutdown = langwell_udc_shutdown, }; - -static int __init init (void ) -{ -return pci_register_driver (&langwell_pci_driver); -} -module_init (init); - - -static void __exit cleanup(void) -{ -pci_unregister_driver (&langwell_pci_driver); -} -module_exit (cleanup); - +module_pci_driver (langwell_pci_driver);MODULE_DESCRIPTION (DRIVER_DESC );MODULE_AUTHOR ("Xiaochen Shen <[email protected]>" );MODULE_VERSION (DRIVER_VERSION );MODULE_LICENSE ("GPL" ); -
drivers/usb/gadget/pch_udc.c +1 -12
@@ -3282,7 +3282,6 @@ static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = {MODULE_DEVICE_TABLE (pci, pch_udc_pcidev_id); -static struct pci_driver pch_udc_driver = { .name =KBUILD_MODNAME , .id_table = pch_udc_pcidev_id,
@@ -3293,17 +3292,7 @@ static struct pci_driver pch_udc_driver = { .shutdown = pch_udc_shutdown, }; -static int __init pch_udc_pci_init (void ) -{ -return pci_register_driver (&pch_udc_driver); -} -module_init (pch_udc_pci_init); - -static void __exit pch_udc_pci_exit(void) -{ -pci_unregister_driver (&pch_udc_driver); -} -module_exit (pch_udc_pci_exit); +module_pci_driver (pch_udc_driver);MODULE_DESCRIPTION ("Intel EG20T USB Device Controller" );MODULE_AUTHOR ("LAPIS Semiconductor, <[email protected]>" );
Signature · 1 line
1.7.5.4
Felipe Balbi
AppliedQuoted 9 lines · Axel Lin
This patch converts the drivers in
drivers/usb/gadget/*to usemodule_pci_driver()macro which makes the code smaller and a bit simpler.Signed-off-by Axel Lin <[email protected]>Cc Thomas Dahlmann <[email protected]>Cc Felipe Balbi <[email protected]>Cc Xiaochen Shen <[email protected]>Cc Pavankumar Kondeti <[email protected]>Cc Greg Kroah-Hartman <[email protected]>
applied, thanks
Signature · 1 line
balbi