diff options
author | Fabio Porcedda <fabio.porcedda@gmail.com> | 2013-01-09 06:15:28 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-17 20:39:34 -0500 |
commit | 52f7a82b59ff385da86a3ed17c8d9f6a83531004 (patch) | |
tree | 8ad525a379e0bee72fbcd74739780230b0d49fc6 | |
parent | 1cb9204cc6e22ec18e62ab0687e2240cbdb15200 (diff) |
usb: converto drivers/usb/* to use module_platform_driver_probe()
This patch converts the drivers in drivers/usb/* to use the
module_platform_driver_probe() macro which makes the code smaller and
a bit simpler.
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Eric Miao <eric.y.miao@gmail.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/fusb300_udc.c | 13 | ||||
-rw-r--r-- | drivers/usb/gadget/imx_udc.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/lpc32xx_udc.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/m66592-udc.c | 12 | ||||
-rw-r--r-- | drivers/usb/gadget/pxa25x_udc.c | 15 | ||||
-rw-r--r-- | drivers/usb/gadget/r8a66597-udc.c | 15 | ||||
-rw-r--r-- | drivers/usb/otg/gpio_vbus.c | 12 | ||||
-rw-r--r-- | drivers/usb/otg/msm_otg.c | 13 |
10 files changed, 13 insertions, 115 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index f4a21f6f081f..0143ffa4e409 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -1982,17 +1982,7 @@ static struct platform_driver at91_udc_driver = { | |||
1982 | }, | 1982 | }, |
1983 | }; | 1983 | }; |
1984 | 1984 | ||
1985 | static int __init udc_init_module(void) | 1985 | module_platform_driver_probe(at91_udc_driver, at91udc_probe); |
1986 | { | ||
1987 | return platform_driver_probe(&at91_udc_driver, at91udc_probe); | ||
1988 | } | ||
1989 | module_init(udc_init_module); | ||
1990 | |||
1991 | static void __exit udc_exit_module(void) | ||
1992 | { | ||
1993 | platform_driver_unregister(&at91_udc_driver); | ||
1994 | } | ||
1995 | module_exit(udc_exit_module); | ||
1996 | 1986 | ||
1997 | MODULE_DESCRIPTION("AT91 udc driver"); | 1987 | MODULE_DESCRIPTION("AT91 udc driver"); |
1998 | MODULE_AUTHOR("Thomas Rathbone, David Brownell"); | 1988 | MODULE_AUTHOR("Thomas Rathbone, David Brownell"); |
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index a7aed84d98c9..bc19496bcec0 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c | |||
@@ -2066,17 +2066,7 @@ static struct platform_driver udc_driver = { | |||
2066 | }, | 2066 | }, |
2067 | }; | 2067 | }; |
2068 | 2068 | ||
2069 | static int __init udc_init(void) | 2069 | module_platform_driver_probe(udc_driver, usba_udc_probe); |
2070 | { | ||
2071 | return platform_driver_probe(&udc_driver, usba_udc_probe); | ||
2072 | } | ||
2073 | module_init(udc_init); | ||
2074 | |||
2075 | static void __exit udc_exit(void) | ||
2076 | { | ||
2077 | platform_driver_unregister(&udc_driver); | ||
2078 | } | ||
2079 | module_exit(udc_exit); | ||
2080 | 2070 | ||
2081 | MODULE_DESCRIPTION("Atmel USBA UDC driver"); | 2071 | MODULE_DESCRIPTION("Atmel USBA UDC driver"); |
2082 | MODULE_AUTHOR("Haavard Skinnemoen (Atmel)"); | 2072 | MODULE_AUTHOR("Haavard Skinnemoen (Atmel)"); |
diff --git a/drivers/usb/gadget/fusb300_udc.c b/drivers/usb/gadget/fusb300_udc.c index 72cd5e6719db..fc7cb09ab52b 100644 --- a/drivers/usb/gadget/fusb300_udc.c +++ b/drivers/usb/gadget/fusb300_udc.c | |||
@@ -1547,15 +1547,4 @@ static struct platform_driver fusb300_driver = { | |||
1547 | }, | 1547 | }, |
1548 | }; | 1548 | }; |
1549 | 1549 | ||
1550 | static int __init fusb300_udc_init(void) | 1550 | module_platform_driver_probe(fusb300_driver, fusb300_probe); |
1551 | { | ||
1552 | return platform_driver_probe(&fusb300_driver, fusb300_probe); | ||
1553 | } | ||
1554 | |||
1555 | module_init(fusb300_udc_init); | ||
1556 | |||
1557 | static void __exit fusb300_udc_cleanup(void) | ||
1558 | { | ||
1559 | platform_driver_unregister(&fusb300_driver); | ||
1560 | } | ||
1561 | module_exit(fusb300_udc_cleanup); | ||
diff --git a/drivers/usb/gadget/imx_udc.c b/drivers/usb/gadget/imx_udc.c index a0eb85794fd4..8efd7555fa21 100644 --- a/drivers/usb/gadget/imx_udc.c +++ b/drivers/usb/gadget/imx_udc.c | |||
@@ -1556,17 +1556,7 @@ static struct platform_driver udc_driver = { | |||
1556 | .resume = imx_udc_resume, | 1556 | .resume = imx_udc_resume, |
1557 | }; | 1557 | }; |
1558 | 1558 | ||
1559 | static int __init udc_init(void) | 1559 | module_platform_driver_probe(udc_driver, imx_udc_probe); |
1560 | { | ||
1561 | return platform_driver_probe(&udc_driver, imx_udc_probe); | ||
1562 | } | ||
1563 | module_init(udc_init); | ||
1564 | |||
1565 | static void __exit udc_exit(void) | ||
1566 | { | ||
1567 | platform_driver_unregister(&udc_driver); | ||
1568 | } | ||
1569 | module_exit(udc_exit); | ||
1570 | 1560 | ||
1571 | MODULE_DESCRIPTION("IMX USB Device Controller driver"); | 1561 | MODULE_DESCRIPTION("IMX USB Device Controller driver"); |
1572 | MODULE_AUTHOR("Darius Augulis <augulis.darius@gmail.com>"); | 1562 | MODULE_AUTHOR("Darius Augulis <augulis.darius@gmail.com>"); |
diff --git a/drivers/usb/gadget/lpc32xx_udc.c b/drivers/usb/gadget/lpc32xx_udc.c index dd1c9b1fe528..aa04089d6899 100644 --- a/drivers/usb/gadget/lpc32xx_udc.c +++ b/drivers/usb/gadget/lpc32xx_udc.c | |||
@@ -3458,17 +3458,7 @@ static struct platform_driver lpc32xx_udc_driver = { | |||
3458 | }, | 3458 | }, |
3459 | }; | 3459 | }; |
3460 | 3460 | ||
3461 | static int __init udc_init_module(void) | 3461 | module_platform_driver_probe(lpc32xx_udc_driver, lpc32xx_udc_probe); |
3462 | { | ||
3463 | return platform_driver_probe(&lpc32xx_udc_driver, lpc32xx_udc_probe); | ||
3464 | } | ||
3465 | module_init(udc_init_module); | ||
3466 | |||
3467 | static void __exit udc_exit_module(void) | ||
3468 | { | ||
3469 | platform_driver_unregister(&lpc32xx_udc_driver); | ||
3470 | } | ||
3471 | module_exit(udc_exit_module); | ||
3472 | 3462 | ||
3473 | MODULE_DESCRIPTION("LPC32XX udc driver"); | 3463 | MODULE_DESCRIPTION("LPC32XX udc driver"); |
3474 | MODULE_AUTHOR("Kevin Wells <kevin.wells@nxp.com>"); | 3464 | MODULE_AUTHOR("Kevin Wells <kevin.wells@nxp.com>"); |
diff --git a/drivers/usb/gadget/m66592-udc.c b/drivers/usb/gadget/m66592-udc.c index b6401f1b56ce..dfce0cfe4e6f 100644 --- a/drivers/usb/gadget/m66592-udc.c +++ b/drivers/usb/gadget/m66592-udc.c | |||
@@ -1753,14 +1753,4 @@ static struct platform_driver m66592_driver = { | |||
1753 | }, | 1753 | }, |
1754 | }; | 1754 | }; |
1755 | 1755 | ||
1756 | static int __init m66592_udc_init(void) | 1756 | module_platform_driver_probe(m66592_driver, m66592_probe); |
1757 | { | ||
1758 | return platform_driver_probe(&m66592_driver, m66592_probe); | ||
1759 | } | ||
1760 | module_init(m66592_udc_init); | ||
1761 | |||
1762 | static void __exit m66592_udc_cleanup(void) | ||
1763 | { | ||
1764 | platform_driver_unregister(&m66592_driver); | ||
1765 | } | ||
1766 | module_exit(m66592_udc_cleanup); | ||
diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index d4ca9f1f7f24..d52e869ce202 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c | |||
@@ -2100,6 +2100,8 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev) | |||
2100 | int retval, irq; | 2100 | int retval, irq; |
2101 | u32 chiprev; | 2101 | u32 chiprev; |
2102 | 2102 | ||
2103 | pr_info("%s: version %s\n", driver_name, DRIVER_VERSION); | ||
2104 | |||
2103 | /* insist on Intel/ARM/XScale */ | 2105 | /* insist on Intel/ARM/XScale */ |
2104 | asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev)); | 2106 | asm("mrc%? p15, 0, %0, c0, c0" : "=r" (chiprev)); |
2105 | if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) { | 2107 | if ((chiprev & CP15R0_VENDOR_MASK) != CP15R0_XSCALE_VALUE) { |
@@ -2346,18 +2348,7 @@ static struct platform_driver udc_driver = { | |||
2346 | }, | 2348 | }, |
2347 | }; | 2349 | }; |
2348 | 2350 | ||
2349 | static int __init udc_init(void) | 2351 | module_platform_driver_probe(udc_driver, pxa25x_udc_probe); |
2350 | { | ||
2351 | pr_info("%s: version %s\n", driver_name, DRIVER_VERSION); | ||
2352 | return platform_driver_probe(&udc_driver, pxa25x_udc_probe); | ||
2353 | } | ||
2354 | module_init(udc_init); | ||
2355 | |||
2356 | static void __exit udc_exit(void) | ||
2357 | { | ||
2358 | platform_driver_unregister(&udc_driver); | ||
2359 | } | ||
2360 | module_exit(udc_exit); | ||
2361 | 2352 | ||
2362 | MODULE_DESCRIPTION(DRIVER_DESC); | 2353 | MODULE_DESCRIPTION(DRIVER_DESC); |
2363 | MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell"); | 2354 | MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell"); |
diff --git a/drivers/usb/gadget/r8a66597-udc.c b/drivers/usb/gadget/r8a66597-udc.c index 5a80751accb7..9a9fadd9095f 100644 --- a/drivers/usb/gadget/r8a66597-udc.c +++ b/drivers/usb/gadget/r8a66597-udc.c | |||
@@ -2031,21 +2031,10 @@ static struct platform_driver r8a66597_driver = { | |||
2031 | .name = (char *) udc_name, | 2031 | .name = (char *) udc_name, |
2032 | }, | 2032 | }, |
2033 | }; | 2033 | }; |
2034 | MODULE_ALIAS("platform:r8a66597_udc"); | ||
2035 | |||
2036 | static int __init r8a66597_udc_init(void) | ||
2037 | { | ||
2038 | return platform_driver_probe(&r8a66597_driver, r8a66597_probe); | ||
2039 | } | ||
2040 | module_init(r8a66597_udc_init); | ||
2041 | 2034 | ||
2042 | static void __exit r8a66597_udc_cleanup(void) | 2035 | module_platform_driver_probe(r8a66597_driver, r8a66597_probe); |
2043 | { | ||
2044 | platform_driver_unregister(&r8a66597_driver); | ||
2045 | } | ||
2046 | module_exit(r8a66597_udc_cleanup); | ||
2047 | 2036 | ||
2048 | MODULE_DESCRIPTION("R8A66597 USB gadget driver"); | 2037 | MODULE_DESCRIPTION("R8A66597 USB gadget driver"); |
2049 | MODULE_LICENSE("GPL"); | 2038 | MODULE_LICENSE("GPL"); |
2050 | MODULE_AUTHOR("Yoshihiro Shimoda"); | 2039 | MODULE_AUTHOR("Yoshihiro Shimoda"); |
2051 | 2040 | MODULE_ALIAS("platform:r8a66597_udc"); | |
diff --git a/drivers/usb/otg/gpio_vbus.c b/drivers/usb/otg/gpio_vbus.c index a67ffe22179a..a7d4ac591982 100644 --- a/drivers/usb/otg/gpio_vbus.c +++ b/drivers/usb/otg/gpio_vbus.c | |||
@@ -409,17 +409,7 @@ static struct platform_driver gpio_vbus_driver = { | |||
409 | .remove = __exit_p(gpio_vbus_remove), | 409 | .remove = __exit_p(gpio_vbus_remove), |
410 | }; | 410 | }; |
411 | 411 | ||
412 | static int __init gpio_vbus_init(void) | 412 | module_platform_driver_probe(gpio_vbus_driver, gpio_vbus_probe); |
413 | { | ||
414 | return platform_driver_probe(&gpio_vbus_driver, gpio_vbus_probe); | ||
415 | } | ||
416 | module_init(gpio_vbus_init); | ||
417 | |||
418 | static void __exit gpio_vbus_exit(void) | ||
419 | { | ||
420 | platform_driver_unregister(&gpio_vbus_driver); | ||
421 | } | ||
422 | module_exit(gpio_vbus_exit); | ||
423 | 413 | ||
424 | MODULE_DESCRIPTION("simple GPIO controlled OTG transceiver driver"); | 414 | MODULE_DESCRIPTION("simple GPIO controlled OTG transceiver driver"); |
425 | MODULE_AUTHOR("Philipp Zabel"); | 415 | MODULE_AUTHOR("Philipp Zabel"); |
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c index 3b9f0d951132..749fbf41fb6f 100644 --- a/drivers/usb/otg/msm_otg.c +++ b/drivers/usb/otg/msm_otg.c | |||
@@ -1756,18 +1756,7 @@ static struct platform_driver msm_otg_driver = { | |||
1756 | }, | 1756 | }, |
1757 | }; | 1757 | }; |
1758 | 1758 | ||
1759 | static int __init msm_otg_init(void) | 1759 | module_platform_driver_probe(msm_otg_driver, msm_otg_probe); |
1760 | { | ||
1761 | return platform_driver_probe(&msm_otg_driver, msm_otg_probe); | ||
1762 | } | ||
1763 | |||
1764 | static void __exit msm_otg_exit(void) | ||
1765 | { | ||
1766 | platform_driver_unregister(&msm_otg_driver); | ||
1767 | } | ||
1768 | |||
1769 | module_init(msm_otg_init); | ||
1770 | module_exit(msm_otg_exit); | ||
1771 | 1760 | ||
1772 | MODULE_LICENSE("GPL v2"); | 1761 | MODULE_LICENSE("GPL v2"); |
1773 | MODULE_DESCRIPTION("MSM USB transceiver driver"); | 1762 | MODULE_DESCRIPTION("MSM USB transceiver driver"); |