diff options
author | Axel Lin <axel.lin@gmail.com> | 2012-04-04 10:14:58 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-05-04 08:52:50 -0400 |
commit | 3cdb772160c13ae6c162fe729460dc11f8437eec (patch) | |
tree | 8e2a7cd1da0715199b8236c6f8f3ba876f764a82 | |
parent | 66f75a5d028beaf67c931435fdc3e7823125730c (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.c | 14 | ||||
-rw-r--r-- | drivers/usb/gadget/ci13xxx_pci.c | 22 | ||||
-rw-r--r-- | drivers/usb/gadget/goku_udc.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/langwell_udc.c | 16 | ||||
-rw-r--r-- | drivers/usb/gadget/pch_udc.c | 13 |
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 */ | 3405 | module_pci_driver(udc_pci_driver); |
3406 | static int __init init(void) | ||
3407 | { | ||
3408 | return pci_register_driver(&udc_pci_driver); | ||
3409 | } | ||
3410 | module_init(init); | ||
3411 | |||
3412 | /* Cleans driver */ | ||
3413 | static void __exit cleanup(void) | ||
3414 | { | ||
3415 | pci_unregister_driver(&udc_pci_driver); | ||
3416 | } | ||
3417 | module_exit(cleanup); | ||
3418 | 3406 | ||
3419 | MODULE_DESCRIPTION(UDC_MOD_DESCRIPTION); | 3407 | MODULE_DESCRIPTION(UDC_MOD_DESCRIPTION); |
3420 | MODULE_AUTHOR("Thomas Dahlmann"); | 3408 | MODULE_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 | /** | 151 | module_pci_driver(ci13xxx_pci_driver); |
152 | * ci13xxx_pci_init: module init | ||
153 | * | ||
154 | * Driver load | ||
155 | */ | ||
156 | static int __init ci13xxx_pci_init(void) | ||
157 | { | ||
158 | return pci_register_driver(&ci13xxx_pci_driver); | ||
159 | } | ||
160 | module_init(ci13xxx_pci_init); | ||
161 | |||
162 | /** | ||
163 | * ci13xxx_pci_exit: module exit | ||
164 | * | ||
165 | * Driver unload | ||
166 | */ | ||
167 | static void __exit ci13xxx_pci_exit(void) | ||
168 | { | ||
169 | pci_unregister_driver(&ci13xxx_pci_driver); | ||
170 | } | ||
171 | module_exit(ci13xxx_pci_exit); | ||
172 | 152 | ||
173 | MODULE_AUTHOR("MIPS - David Lopo <dlopo@chipidea.mips.com>"); | 153 | MODULE_AUTHOR("MIPS - David Lopo <dlopo@chipidea.mips.com>"); |
174 | MODULE_DESCRIPTION("MIPS CI13XXX USB Peripheral Controller"); | 154 | MODULE_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 | ||
1898 | static int __init init (void) | 1898 | module_pci_driver(goku_pci_driver); |
1899 | { | ||
1900 | return pci_register_driver (&goku_pci_driver); | ||
1901 | } | ||
1902 | module_init (init); | ||
1903 | |||
1904 | static void __exit cleanup (void) | ||
1905 | { | ||
1906 | pci_unregister_driver (&goku_pci_driver); | ||
1907 | } | ||
1908 | module_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 | 3415 | module_pci_driver(langwell_pci_driver); | |
3416 | static int __init init(void) | ||
3417 | { | ||
3418 | return pci_register_driver(&langwell_pci_driver); | ||
3419 | } | ||
3420 | module_init(init); | ||
3421 | |||
3422 | |||
3423 | static void __exit cleanup(void) | ||
3424 | { | ||
3425 | pci_unregister_driver(&langwell_pci_driver); | ||
3426 | } | ||
3427 | module_exit(cleanup); | ||
3428 | |||
3429 | 3416 | ||
3430 | MODULE_DESCRIPTION(DRIVER_DESC); | 3417 | MODULE_DESCRIPTION(DRIVER_DESC); |
3431 | MODULE_AUTHOR("Xiaochen Shen <xiaochen.shen@intel.com>"); | 3418 | MODULE_AUTHOR("Xiaochen Shen <xiaochen.shen@intel.com>"); |
3432 | MODULE_VERSION(DRIVER_VERSION); | 3419 | MODULE_VERSION(DRIVER_VERSION); |
3433 | MODULE_LICENSE("GPL"); | 3420 | MODULE_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 | ||
3283 | MODULE_DEVICE_TABLE(pci, pch_udc_pcidev_id); | 3283 | MODULE_DEVICE_TABLE(pci, pch_udc_pcidev_id); |
3284 | 3284 | ||
3285 | |||
3286 | static struct pci_driver pch_udc_driver = { | 3285 | static 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 | ||
3296 | static int __init pch_udc_pci_init(void) | 3295 | module_pci_driver(pch_udc_driver); |
3297 | { | ||
3298 | return pci_register_driver(&pch_udc_driver); | ||
3299 | } | ||
3300 | module_init(pch_udc_pci_init); | ||
3301 | |||
3302 | static void __exit pch_udc_pci_exit(void) | ||
3303 | { | ||
3304 | pci_unregister_driver(&pch_udc_driver); | ||
3305 | } | ||
3306 | module_exit(pch_udc_pci_exit); | ||
3307 | 3296 | ||
3308 | MODULE_DESCRIPTION("Intel EG20T USB Device Controller"); | 3297 | MODULE_DESCRIPTION("Intel EG20T USB Device Controller"); |
3309 | MODULE_AUTHOR("LAPIS Semiconductor, <tomoya-linux@dsn.lapis-semi.com>"); | 3298 | MODULE_AUTHOR("LAPIS Semiconductor, <tomoya-linux@dsn.lapis-semi.com>"); |