diff options
author | Axel Lin <axel.lin@gmail.com> | 2011-11-27 07:16:27 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-27 16:48:32 -0500 |
commit | cc27c96c2bee93068bfc60ea6b09611d88cef429 (patch) | |
tree | 47068da713ecb9f9383b3538831d0d3f3d170460 /drivers/usb | |
parent | c64391f264b7658c00515173cca58f5b054af1a2 (diff) |
usb: convert drivers/usb/* to use module_platform_driver()
This patch converts the drivers in drivers/usb/* to use the
module_platform_driver() macro which makes the code smaller and a bit
simpler.
Cc: Felipe Balbi <balbi@ti.com>
Cc: Li Yang <leoli@freescale.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: Lucas De Marchi <lucas.demarchi@profusion.mobi>
Cc: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/c67x00/c67x00-drv.c | 15 | ||||
-rw-r--r-- | drivers/usb/dwc3/dwc3-omap.c | 14 | ||||
-rw-r--r-- | drivers/usb/gadget/fsl_qe_udc.c | 15 | ||||
-rw-r--r-- | drivers/usb/gadget/mv_udc_core.c | 19 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 13 | ||||
-rw-r--r-- | drivers/usb/gadget/s3c-hsudc.c | 15 | ||||
-rw-r--r-- | drivers/usb/host/fhci-hcd.c | 12 | ||||
-rw-r--r-- | drivers/usb/host/fsl-mph-dr-of.c | 12 | ||||
-rw-r--r-- | drivers/usb/host/imx21-hcd.c | 13 | ||||
-rw-r--r-- | drivers/usb/host/oxu210hp-hcd.c | 19 | ||||
-rw-r--r-- | drivers/usb/otg/fsl_otg.c | 13 | ||||
-rw-r--r-- | drivers/usb/renesas_usbhs/common.c | 13 |
12 files changed, 17 insertions, 156 deletions
diff --git a/drivers/usb/c67x00/c67x00-drv.c b/drivers/usb/c67x00/c67x00-drv.c index 57ae44cd0b88..6f3b6e267398 100644 --- a/drivers/usb/c67x00/c67x00-drv.c +++ b/drivers/usb/c67x00/c67x00-drv.c | |||
@@ -225,21 +225,10 @@ static struct platform_driver c67x00_driver = { | |||
225 | .name = "c67x00", | 225 | .name = "c67x00", |
226 | }, | 226 | }, |
227 | }; | 227 | }; |
228 | MODULE_ALIAS("platform:c67x00"); | ||
229 | |||
230 | static int __init c67x00_init(void) | ||
231 | { | ||
232 | return platform_driver_register(&c67x00_driver); | ||
233 | } | ||
234 | 228 | ||
235 | static void __exit c67x00_exit(void) | 229 | module_platform_driver(c67x00_driver); |
236 | { | ||
237 | platform_driver_unregister(&c67x00_driver); | ||
238 | } | ||
239 | |||
240 | module_init(c67x00_init); | ||
241 | module_exit(c67x00_exit); | ||
242 | 230 | ||
243 | MODULE_AUTHOR("Peter Korsgaard, Jan Veldeman, Grant Likely"); | 231 | MODULE_AUTHOR("Peter Korsgaard, Jan Veldeman, Grant Likely"); |
244 | MODULE_DESCRIPTION("Cypress C67X00 USB Controller Driver"); | 232 | MODULE_DESCRIPTION("Cypress C67X00 USB Controller Driver"); |
245 | MODULE_LICENSE("GPL"); | 233 | MODULE_LICENSE("GPL"); |
234 | MODULE_ALIAS("platform:c67x00"); | ||
diff --git a/drivers/usb/dwc3/dwc3-omap.c b/drivers/usb/dwc3/dwc3-omap.c index 062552b5fc8a..4e27d5bf40ad 100644 --- a/drivers/usb/dwc3/dwc3-omap.c +++ b/drivers/usb/dwc3/dwc3-omap.c | |||
@@ -384,18 +384,8 @@ static struct platform_driver dwc3_omap_driver = { | |||
384 | }, | 384 | }, |
385 | }; | 385 | }; |
386 | 386 | ||
387 | module_platform_driver(dwc3_omap_driver); | ||
388 | |||
387 | MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); | 389 | MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>"); |
388 | MODULE_LICENSE("Dual BSD/GPL"); | 390 | MODULE_LICENSE("Dual BSD/GPL"); |
389 | MODULE_DESCRIPTION("DesignWare USB3 OMAP Glue Layer"); | 391 | MODULE_DESCRIPTION("DesignWare USB3 OMAP Glue Layer"); |
390 | |||
391 | static int __devinit dwc3_omap_init(void) | ||
392 | { | ||
393 | return platform_driver_register(&dwc3_omap_driver); | ||
394 | } | ||
395 | module_init(dwc3_omap_init); | ||
396 | |||
397 | static void __exit dwc3_omap_exit(void) | ||
398 | { | ||
399 | platform_driver_unregister(&dwc3_omap_driver); | ||
400 | } | ||
401 | module_exit(dwc3_omap_exit); | ||
diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 2a03e4de11c1..811ea76ae76e 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c | |||
@@ -2815,20 +2815,7 @@ static struct platform_driver udc_driver = { | |||
2815 | #endif | 2815 | #endif |
2816 | }; | 2816 | }; |
2817 | 2817 | ||
2818 | static int __init qe_udc_init(void) | 2818 | module_platform_driver(udc_driver); |
2819 | { | ||
2820 | printk(KERN_INFO "%s: %s, %s\n", driver_name, driver_desc, | ||
2821 | DRIVER_VERSION); | ||
2822 | return platform_driver_register(&udc_driver); | ||
2823 | } | ||
2824 | |||
2825 | static void __exit qe_udc_exit(void) | ||
2826 | { | ||
2827 | platform_driver_unregister(&udc_driver); | ||
2828 | } | ||
2829 | |||
2830 | module_init(qe_udc_init); | ||
2831 | module_exit(qe_udc_exit); | ||
2832 | 2819 | ||
2833 | MODULE_DESCRIPTION(DRIVER_DESC); | 2820 | MODULE_DESCRIPTION(DRIVER_DESC); |
2834 | MODULE_AUTHOR(DRIVER_AUTHOR); | 2821 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/usb/gadget/mv_udc_core.c b/drivers/usb/gadget/mv_udc_core.c index 892412103dd8..0114fd33fbe2 100644 --- a/drivers/usb/gadget/mv_udc_core.c +++ b/drivers/usb/gadget/mv_udc_core.c | |||
@@ -2463,24 +2463,11 @@ static struct platform_driver udc_driver = { | |||
2463 | #endif | 2463 | #endif |
2464 | }, | 2464 | }, |
2465 | }; | 2465 | }; |
2466 | MODULE_ALIAS("platform:pxa-u2o"); | 2466 | |
2467 | module_platform_driver(udc_driver); | ||
2467 | 2468 | ||
2468 | MODULE_DESCRIPTION(DRIVER_DESC); | 2469 | MODULE_DESCRIPTION(DRIVER_DESC); |
2469 | MODULE_AUTHOR("Chao Xie <chao.xie@marvell.com>"); | 2470 | MODULE_AUTHOR("Chao Xie <chao.xie@marvell.com>"); |
2470 | MODULE_VERSION(DRIVER_VERSION); | 2471 | MODULE_VERSION(DRIVER_VERSION); |
2471 | MODULE_LICENSE("GPL"); | 2472 | MODULE_LICENSE("GPL"); |
2472 | 2473 | MODULE_ALIAS("platform:pxa-u2o"); | |
2473 | |||
2474 | static int __init init(void) | ||
2475 | { | ||
2476 | return platform_driver_register(&udc_driver); | ||
2477 | } | ||
2478 | module_init(init); | ||
2479 | |||
2480 | |||
2481 | static void __exit cleanup(void) | ||
2482 | { | ||
2483 | platform_driver_unregister(&udc_driver); | ||
2484 | } | ||
2485 | module_exit(cleanup); | ||
2486 | |||
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index a552453dc946..745a3081fb37 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -3469,18 +3469,7 @@ static struct platform_driver s3c_hsotg_driver = { | |||
3469 | .resume = s3c_hsotg_resume, | 3469 | .resume = s3c_hsotg_resume, |
3470 | }; | 3470 | }; |
3471 | 3471 | ||
3472 | static int __init s3c_hsotg_modinit(void) | 3472 | module_platform_driver(s3c_hsotg_driver); |
3473 | { | ||
3474 | return platform_driver_register(&s3c_hsotg_driver); | ||
3475 | } | ||
3476 | |||
3477 | static void __exit s3c_hsotg_modexit(void) | ||
3478 | { | ||
3479 | platform_driver_unregister(&s3c_hsotg_driver); | ||
3480 | } | ||
3481 | |||
3482 | module_init(s3c_hsotg_modinit); | ||
3483 | module_exit(s3c_hsotg_modexit); | ||
3484 | 3473 | ||
3485 | MODULE_DESCRIPTION("Samsung S3C USB High-speed/OtG device"); | 3474 | MODULE_DESCRIPTION("Samsung S3C USB High-speed/OtG device"); |
3486 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); | 3475 | MODULE_AUTHOR("Ben Dooks <ben@simtec.co.uk>"); |
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index 8d54f893cefe..baf506a66ded 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c | |||
@@ -1378,21 +1378,10 @@ static struct platform_driver s3c_hsudc_driver = { | |||
1378 | }, | 1378 | }, |
1379 | .probe = s3c_hsudc_probe, | 1379 | .probe = s3c_hsudc_probe, |
1380 | }; | 1380 | }; |
1381 | MODULE_ALIAS("platform:s3c-hsudc"); | ||
1382 | |||
1383 | static int __init s3c_hsudc_modinit(void) | ||
1384 | { | ||
1385 | return platform_driver_register(&s3c_hsudc_driver); | ||
1386 | } | ||
1387 | 1381 | ||
1388 | static void __exit s3c_hsudc_modexit(void) | 1382 | module_platform_driver(s3c_hsudc_driver); |
1389 | { | ||
1390 | platform_driver_unregister(&s3c_hsudc_driver); | ||
1391 | } | ||
1392 | |||
1393 | module_init(s3c_hsudc_modinit); | ||
1394 | module_exit(s3c_hsudc_modexit); | ||
1395 | 1383 | ||
1396 | MODULE_DESCRIPTION("Samsung S3C24XX USB high-speed controller driver"); | 1384 | MODULE_DESCRIPTION("Samsung S3C24XX USB high-speed controller driver"); |
1397 | MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>"); | 1385 | MODULE_AUTHOR("Thomas Abraham <thomas.ab@samsung.com>"); |
1398 | MODULE_LICENSE("GPL"); | 1386 | MODULE_LICENSE("GPL"); |
1387 | MODULE_ALIAS("platform:s3c-hsudc"); | ||
diff --git a/drivers/usb/host/fhci-hcd.c b/drivers/usb/host/fhci-hcd.c index 4ed6d19f2a54..d2623747b489 100644 --- a/drivers/usb/host/fhci-hcd.c +++ b/drivers/usb/host/fhci-hcd.c | |||
@@ -824,17 +824,7 @@ static struct platform_driver of_fhci_driver = { | |||
824 | .remove = __devexit_p(of_fhci_remove), | 824 | .remove = __devexit_p(of_fhci_remove), |
825 | }; | 825 | }; |
826 | 826 | ||
827 | static int __init fhci_module_init(void) | 827 | module_platform_driver(of_fhci_driver); |
828 | { | ||
829 | return platform_driver_register(&of_fhci_driver); | ||
830 | } | ||
831 | module_init(fhci_module_init); | ||
832 | |||
833 | static void __exit fhci_module_exit(void) | ||
834 | { | ||
835 | platform_driver_unregister(&of_fhci_driver); | ||
836 | } | ||
837 | module_exit(fhci_module_exit); | ||
838 | 828 | ||
839 | MODULE_DESCRIPTION("USB Freescale Host Controller Interface Driver"); | 829 | MODULE_DESCRIPTION("USB Freescale Host Controller Interface Driver"); |
840 | MODULE_AUTHOR("Shlomi Gridish <gridish@freescale.com>, " | 830 | MODULE_AUTHOR("Shlomi Gridish <gridish@freescale.com>, " |
diff --git a/drivers/usb/host/fsl-mph-dr-of.c b/drivers/usb/host/fsl-mph-dr-of.c index 9037035ad1e4..7916e56a725e 100644 --- a/drivers/usb/host/fsl-mph-dr-of.c +++ b/drivers/usb/host/fsl-mph-dr-of.c | |||
@@ -297,17 +297,7 @@ static struct platform_driver fsl_usb2_mph_dr_driver = { | |||
297 | .remove = __devexit_p(fsl_usb2_mph_dr_of_remove), | 297 | .remove = __devexit_p(fsl_usb2_mph_dr_of_remove), |
298 | }; | 298 | }; |
299 | 299 | ||
300 | static int __init fsl_usb2_mph_dr_init(void) | 300 | module_platform_driver(fsl_usb2_mph_dr_driver); |
301 | { | ||
302 | return platform_driver_register(&fsl_usb2_mph_dr_driver); | ||
303 | } | ||
304 | module_init(fsl_usb2_mph_dr_init); | ||
305 | |||
306 | static void __exit fsl_usb2_mph_dr_exit(void) | ||
307 | { | ||
308 | platform_driver_unregister(&fsl_usb2_mph_dr_driver); | ||
309 | } | ||
310 | module_exit(fsl_usb2_mph_dr_exit); | ||
311 | 301 | ||
312 | MODULE_DESCRIPTION("FSL MPH DR OF devices driver"); | 302 | MODULE_DESCRIPTION("FSL MPH DR OF devices driver"); |
313 | MODULE_AUTHOR("Anatolij Gustschin <agust@denx.de>"); | 303 | MODULE_AUTHOR("Anatolij Gustschin <agust@denx.de>"); |
diff --git a/drivers/usb/host/imx21-hcd.c b/drivers/usb/host/imx21-hcd.c index 2ee18cfa1efe..6923bcb8aa68 100644 --- a/drivers/usb/host/imx21-hcd.c +++ b/drivers/usb/host/imx21-hcd.c | |||
@@ -1924,18 +1924,7 @@ static struct platform_driver imx21_hcd_driver = { | |||
1924 | .resume = NULL, | 1924 | .resume = NULL, |
1925 | }; | 1925 | }; |
1926 | 1926 | ||
1927 | static int __init imx21_hcd_init(void) | 1927 | module_platform_driver(imx21_hcd_driver); |
1928 | { | ||
1929 | return platform_driver_register(&imx21_hcd_driver); | ||
1930 | } | ||
1931 | |||
1932 | static void __exit imx21_hcd_cleanup(void) | ||
1933 | { | ||
1934 | platform_driver_unregister(&imx21_hcd_driver); | ||
1935 | } | ||
1936 | |||
1937 | module_init(imx21_hcd_init); | ||
1938 | module_exit(imx21_hcd_cleanup); | ||
1939 | 1928 | ||
1940 | MODULE_DESCRIPTION("i.MX21 USB Host controller"); | 1929 | MODULE_DESCRIPTION("i.MX21 USB Host controller"); |
1941 | MODULE_AUTHOR("Martin Fuzzey"); | 1930 | MODULE_AUTHOR("Martin Fuzzey"); |
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c index dcd889803f0f..6f62de5c6e35 100644 --- a/drivers/usb/host/oxu210hp-hcd.c +++ b/drivers/usb/host/oxu210hp-hcd.c | |||
@@ -3951,24 +3951,7 @@ static struct platform_driver oxu_driver = { | |||
3951 | } | 3951 | } |
3952 | }; | 3952 | }; |
3953 | 3953 | ||
3954 | static int __init oxu_module_init(void) | 3954 | module_platform_driver(oxu_driver); |
3955 | { | ||
3956 | int retval = 0; | ||
3957 | |||
3958 | retval = platform_driver_register(&oxu_driver); | ||
3959 | if (retval < 0) | ||
3960 | return retval; | ||
3961 | |||
3962 | return retval; | ||
3963 | } | ||
3964 | |||
3965 | static void __exit oxu_module_cleanup(void) | ||
3966 | { | ||
3967 | platform_driver_unregister(&oxu_driver); | ||
3968 | } | ||
3969 | |||
3970 | module_init(oxu_module_init); | ||
3971 | module_exit(oxu_module_cleanup); | ||
3972 | 3955 | ||
3973 | MODULE_DESCRIPTION("Oxford OXU210HP HCD driver - ver. " DRIVER_VERSION); | 3956 | MODULE_DESCRIPTION("Oxford OXU210HP HCD driver - ver. " DRIVER_VERSION); |
3974 | MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>"); | 3957 | MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>"); |
diff --git a/drivers/usb/otg/fsl_otg.c b/drivers/usb/otg/fsl_otg.c index 0f420b25e9a9..2a52ff1b493d 100644 --- a/drivers/usb/otg/fsl_otg.c +++ b/drivers/usb/otg/fsl_otg.c | |||
@@ -1151,18 +1151,7 @@ struct platform_driver fsl_otg_driver = { | |||
1151 | }, | 1151 | }, |
1152 | }; | 1152 | }; |
1153 | 1153 | ||
1154 | static int __init fsl_usb_otg_init(void) | 1154 | module_platform_driver(fsl_otg_driver); |
1155 | { | ||
1156 | pr_info(DRIVER_INFO "\n"); | ||
1157 | return platform_driver_register(&fsl_otg_driver); | ||
1158 | } | ||
1159 | module_init(fsl_usb_otg_init); | ||
1160 | |||
1161 | static void __exit fsl_usb_otg_exit(void) | ||
1162 | { | ||
1163 | platform_driver_unregister(&fsl_otg_driver); | ||
1164 | } | ||
1165 | module_exit(fsl_usb_otg_exit); | ||
1166 | 1155 | ||
1167 | MODULE_DESCRIPTION(DRIVER_INFO); | 1156 | MODULE_DESCRIPTION(DRIVER_INFO); |
1168 | MODULE_AUTHOR(DRIVER_AUTHOR); | 1157 | MODULE_AUTHOR(DRIVER_AUTHOR); |
diff --git a/drivers/usb/renesas_usbhs/common.c b/drivers/usb/renesas_usbhs/common.c index 08c679c0dde5..aa94e33e6885 100644 --- a/drivers/usb/renesas_usbhs/common.c +++ b/drivers/usb/renesas_usbhs/common.c | |||
@@ -637,18 +637,7 @@ static struct platform_driver renesas_usbhs_driver = { | |||
637 | .remove = __devexit_p(usbhs_remove), | 637 | .remove = __devexit_p(usbhs_remove), |
638 | }; | 638 | }; |
639 | 639 | ||
640 | static int __init usbhs_init(void) | 640 | module_platform_driver(renesas_usbhs_driver); |
641 | { | ||
642 | return platform_driver_register(&renesas_usbhs_driver); | ||
643 | } | ||
644 | |||
645 | static void __exit usbhs_exit(void) | ||
646 | { | ||
647 | platform_driver_unregister(&renesas_usbhs_driver); | ||
648 | } | ||
649 | |||
650 | module_init(usbhs_init); | ||
651 | module_exit(usbhs_exit); | ||
652 | 641 | ||
653 | MODULE_LICENSE("GPL"); | 642 | MODULE_LICENSE("GPL"); |
654 | MODULE_DESCRIPTION("Renesas USB driver"); | 643 | MODULE_DESCRIPTION("Renesas USB driver"); |