]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
usb: gadget: use module_pci_driver
authorAxel Lin <axel.lin@gmail.com>
Wed, 4 Apr 2012 14:14:58 +0000 (22:14 +0800)
committerFelipe Balbi <balbi@ti.com>
Fri, 4 May 2012 12:52:50 +0000 (15:52 +0300)
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 <axel.lin@gmail.com>
Cc: Thomas Dahlmann <dahlmann.thomas@arcor.de>
Cc: Xiaochen Shen <xiaochen.shen@intel.com>
Cc: Pavankumar Kondeti <pkondeti@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/amd5536udc.c
drivers/usb/gadget/ci13xxx_pci.c
drivers/usb/gadget/goku_udc.c
drivers/usb/gadget/langwell_udc.c
drivers/usb/gadget/pch_udc.c

index 77779271f4872f4d99e50bc05baa7506dea7cc11..e6bb1071cfe3a80d8c099692936b4dcf7fb068e6 100644 (file)
@@ -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");
index 883ab5e832d11ad0bc6928dbaa134f84d920d160..63ef96c04bb7d77ea278707dfd56a229cb1cf1b9 100644 (file)
@@ -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 <dlopo@chipidea.mips.com>");
 MODULE_DESCRIPTION("MIPS CI13XXX USB Peripheral Controller");
index e151d6b87dee09966427e838db114119012cb66a..6ae874ea5b5b8e5763898de0cf6fd540f673891f 100644 (file)
@@ -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);
index f9cedd52cf200b375d486e06fe2c6107db8c5714..130811258d229202704ba64bfd243105a85083b2 100644 (file)
@@ -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 <xiaochen.shen@intel.com>");
 MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE("GPL");
-
index 65307064a6fdc47fac6b3d9b85986a1c5b78e97f..3143a83acd09edb53018e10209c3c8cb8798d025 100644 (file)
@@ -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, <tomoya-linux@dsn.lapis-semi.com>");