aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-04-04 10:14:58 -0400
committerFelipe Balbi <balbi@ti.com>2012-05-04 08:52:50 -0400
commit3cdb772160c13ae6c162fe729460dc11f8437eec (patch)
tree8e2a7cd1da0715199b8236c6f8f3ba876f764a82
parent66f75a5d028beaf67c931435fdc3e7823125730c (diff)
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 <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>
-rw-r--r--drivers/usb/gadget/amd5536udc.c14
-rw-r--r--drivers/usb/gadget/ci13xxx_pci.c22
-rw-r--r--drivers/usb/gadget/goku_udc.c12
-rw-r--r--drivers/usb/gadget/langwell_udc.c16
-rw-r--r--drivers/usb/gadget/pch_udc.c13
5 files changed, 5 insertions, 72 deletions
diff --git a/drivers/usb/gadget/amd5536udc.c b/drivers/usb/gadget/amd5536udc.c
index 77779271f487..e6bb1071cfe3 100644
--- a/drivers/usb/gadget/amd5536udc.c
+++ b/drivers/usb/gadget/amd5536udc.c
@@ -3402,19 +3402,7 @@ static struct pci_driver udc_pci_driver = {
3402 .remove = udc_pci_remove, 3402 .remove = udc_pci_remove,
3403}; 3403};
3404 3404
3405/* Inits driver */ 3405module_pci_driver(udc_pci_driver);
3406static int __init init(void)
3407{
3408 return pci_register_driver(&udc_pci_driver);
3409}
3410module_init(init);
3411
3412/* Cleans driver */
3413static void __exit cleanup(void)
3414{
3415 pci_unregister_driver(&udc_pci_driver);
3416}
3417module_exit(cleanup);
3418 3406
3419MODULE_DESCRIPTION(UDC_MOD_DESCRIPTION); 3407MODULE_DESCRIPTION(UDC_MOD_DESCRIPTION);
3420MODULE_AUTHOR("Thomas Dahlmann"); 3408MODULE_AUTHOR("Thomas Dahlmann");
diff --git a/drivers/usb/gadget/ci13xxx_pci.c b/drivers/usb/gadget/ci13xxx_pci.c
index 883ab5e832d1..63ef96c04bb7 100644
--- a/drivers/usb/gadget/ci13xxx_pci.c
+++ b/drivers/usb/gadget/ci13xxx_pci.c
@@ -148,27 +148,7 @@ static struct pci_driver ci13xxx_pci_driver = {
148 .remove = __devexit_p(ci13xxx_pci_remove), 148 .remove = __devexit_p(ci13xxx_pci_remove),
149}; 149};
150 150
151/** 151module_pci_driver(ci13xxx_pci_driver);
152 * ci13xxx_pci_init: module init
153 *
154 * Driver load
155 */
156static int __init ci13xxx_pci_init(void)
157{
158 return pci_register_driver(&ci13xxx_pci_driver);
159}
160module_init(ci13xxx_pci_init);
161
162/**
163 * ci13xxx_pci_exit: module exit
164 *
165 * Driver unload
166 */
167static void __exit ci13xxx_pci_exit(void)
168{
169 pci_unregister_driver(&ci13xxx_pci_driver);
170}
171module_exit(ci13xxx_pci_exit);
172 152
173MODULE_AUTHOR("MIPS - David Lopo <dlopo@chipidea.mips.com>"); 153MODULE_AUTHOR("MIPS - David Lopo <dlopo@chipidea.mips.com>");
174MODULE_DESCRIPTION("MIPS CI13XXX USB Peripheral Controller"); 154MODULE_DESCRIPTION("MIPS CI13XXX USB Peripheral Controller");
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index e151d6b87dee..6ae874ea5b5b 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c
@@ -1895,14 +1895,4 @@ static struct pci_driver goku_pci_driver = {
1895 /* FIXME add power management support */ 1895 /* FIXME add power management support */
1896}; 1896};
1897 1897
1898static int __init init (void) 1898module_pci_driver(goku_pci_driver);
1899{
1900 return pci_register_driver (&goku_pci_driver);
1901}
1902module_init (init);
1903
1904static void __exit cleanup (void)
1905{
1906 pci_unregister_driver (&goku_pci_driver);
1907}
1908module_exit (cleanup);
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index f9cedd52cf20..130811258d22 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -3412,23 +3412,9 @@ static struct pci_driver langwell_pci_driver = {
3412 .shutdown = langwell_udc_shutdown, 3412 .shutdown = langwell_udc_shutdown,
3413}; 3413};
3414 3414
3415 3415module_pci_driver(langwell_pci_driver);
3416static int __init init(void)
3417{
3418 return pci_register_driver(&langwell_pci_driver);
3419}
3420module_init(init);
3421
3422
3423static void __exit cleanup(void)
3424{
3425 pci_unregister_driver(&langwell_pci_driver);
3426}
3427module_exit(cleanup);
3428
3429 3416
3430MODULE_DESCRIPTION(DRIVER_DESC); 3417MODULE_DESCRIPTION(DRIVER_DESC);
3431MODULE_AUTHOR("Xiaochen Shen <xiaochen.shen@intel.com>"); 3418MODULE_AUTHOR("Xiaochen Shen <xiaochen.shen@intel.com>");
3432MODULE_VERSION(DRIVER_VERSION); 3419MODULE_VERSION(DRIVER_VERSION);
3433MODULE_LICENSE("GPL"); 3420MODULE_LICENSE("GPL");
3434
diff --git a/drivers/usb/gadget/pch_udc.c b/drivers/usb/gadget/pch_udc.c
index 65307064a6fd..3143a83acd09 100644
--- a/drivers/usb/gadget/pch_udc.c
+++ b/drivers/usb/gadget/pch_udc.c
@@ -3282,7 +3282,6 @@ static DEFINE_PCI_DEVICE_TABLE(pch_udc_pcidev_id) = {
3282 3282
3283MODULE_DEVICE_TABLE(pci, pch_udc_pcidev_id); 3283MODULE_DEVICE_TABLE(pci, pch_udc_pcidev_id);
3284 3284
3285
3286static struct pci_driver pch_udc_driver = { 3285static struct pci_driver pch_udc_driver = {
3287 .name = KBUILD_MODNAME, 3286 .name = KBUILD_MODNAME,
3288 .id_table = pch_udc_pcidev_id, 3287 .id_table = pch_udc_pcidev_id,
@@ -3293,17 +3292,7 @@ static struct pci_driver pch_udc_driver = {
3293 .shutdown = pch_udc_shutdown, 3292 .shutdown = pch_udc_shutdown,
3294}; 3293};
3295 3294
3296static int __init pch_udc_pci_init(void) 3295module_pci_driver(pch_udc_driver);
3297{
3298 return pci_register_driver(&pch_udc_driver);
3299}
3300module_init(pch_udc_pci_init);
3301
3302static void __exit pch_udc_pci_exit(void)
3303{
3304 pci_unregister_driver(&pch_udc_driver);
3305}
3306module_exit(pch_udc_pci_exit);
3307 3296
3308MODULE_DESCRIPTION("Intel EG20T USB Device Controller"); 3297MODULE_DESCRIPTION("Intel EG20T USB Device Controller");
3309MODULE_AUTHOR("LAPIS Semiconductor, <tomoya-linux@dsn.lapis-semi.com>"); 3298MODULE_AUTHOR("LAPIS Semiconductor, <tomoya-linux@dsn.lapis-semi.com>");