aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2012-05-29 07:33:30 -0400
committerFelipe Balbi <balbi@ti.com>2012-06-03 16:11:32 -0400
commitdc1737cdd75b692dbdec0e0e22439a0ce1089488 (patch)
tree8cfc7ad86972a7d4d807d73a66f75f21366722df /drivers/usb/gadget
parent5b6d84b78930a4fa3f8380dc0ec4ac427d620201 (diff)
usb: gadget: omap_udc: let it work as a module
this also helps removing a few lines of boilerplate code. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/omap_udc.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c
index 5e7b8912ef31..814aafbed000 100644
--- a/drivers/usb/gadget/omap_udc.c
+++ b/drivers/usb/gadget/omap_udc.c
@@ -2535,7 +2535,7 @@ static inline void remove_proc_file(void) {}
2535 * UDC_SYSCON_1.CFG_LOCK is set can now work. We won't use that 2535 * UDC_SYSCON_1.CFG_LOCK is set can now work. We won't use that
2536 * capability yet though. 2536 * capability yet though.
2537 */ 2537 */
2538static unsigned __init 2538static unsigned __devinit
2539omap_ep_setup(char *name, u8 addr, u8 type, 2539omap_ep_setup(char *name, u8 addr, u8 type,
2540 unsigned buf, unsigned maxp, int dbuf) 2540 unsigned buf, unsigned maxp, int dbuf)
2541{ 2541{
@@ -2653,7 +2653,7 @@ static void omap_udc_release(struct device *dev)
2653 udc = NULL; 2653 udc = NULL;
2654} 2654}
2655 2655
2656static int __init 2656static int __devinit
2657omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv) 2657omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv)
2658{ 2658{
2659 unsigned tmp, buf; 2659 unsigned tmp, buf;
@@ -2790,7 +2790,7 @@ omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv)
2790 return 0; 2790 return 0;
2791} 2791}
2792 2792
2793static int __init omap_udc_probe(struct platform_device *pdev) 2793static int __devinit omap_udc_probe(struct platform_device *pdev)
2794{ 2794{
2795 int status = -ENODEV; 2795 int status = -ENODEV;
2796 int hmc; 2796 int hmc;
@@ -3003,7 +3003,7 @@ cleanup0:
3003 return status; 3003 return status;
3004} 3004}
3005 3005
3006static int __exit omap_udc_remove(struct platform_device *pdev) 3006static int __devexit omap_udc_remove(struct platform_device *pdev)
3007{ 3007{
3008 DECLARE_COMPLETION_ONSTACK(done); 3008 DECLARE_COMPLETION_ONSTACK(done);
3009 3009
@@ -3088,7 +3088,8 @@ static int omap_udc_resume(struct platform_device *dev)
3088/*-------------------------------------------------------------------------*/ 3088/*-------------------------------------------------------------------------*/
3089 3089
3090static struct platform_driver udc_driver = { 3090static struct platform_driver udc_driver = {
3091 .remove = __exit_p(omap_udc_remove), 3091 .probe = omap_udc_probe,
3092 .remove = __devexit_p(omap_udc_remove),
3092 .suspend = omap_udc_suspend, 3093 .suspend = omap_udc_suspend,
3093 .resume = omap_udc_resume, 3094 .resume = omap_udc_resume,
3094 .driver = { 3095 .driver = {
@@ -3097,17 +3098,7 @@ static struct platform_driver udc_driver = {
3097 }, 3098 },
3098}; 3099};
3099 3100
3100static int __init udc_init(void) 3101module_platform_driver(udc_driver);
3101{
3102 return platform_driver_probe(&udc_driver, omap_udc_probe);
3103}
3104module_init(udc_init);
3105
3106static void __exit udc_exit(void)
3107{
3108 platform_driver_unregister(&udc_driver);
3109}
3110module_exit(udc_exit);
3111 3102
3112MODULE_DESCRIPTION(DRIVER_DESC); 3103MODULE_DESCRIPTION(DRIVER_DESC);
3113MODULE_LICENSE("GPL"); 3104MODULE_LICENSE("GPL");