Date:2011-10-25 13:45:17 (10 years 11 months ago)
Author:Maarten ter Huurne
Commit:4adea3bca06ca2a733de118755cbc074d65e9c90
Message:usb: gadget: jz4740: Converted to new registration infrastructure.

Files: drivers/usb/gadget/jz4740_udc.c (9 diffs)

Change Details

drivers/usb/gadget/jz4740_udc.c
160160/*
161161 * Local declarations.
162162 */
163static int jz4740_udc_start(struct usb_gadget_driver *driver,
164        int (*bind)(struct usb_gadget *));
165static int jz4740_udc_stop(struct usb_gadget_driver *driver);
163166static void jz4740_ep0_kick(struct jz4740_udc *dev, struct jz4740_ep *ep);
164167static void jz4740_handle_ep0(struct jz4740_udc *dev, uint32_t intr);
165168
...... 
413416 * Register entry point for the peripheral controller driver.
414417 */
415418
416int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
419static int jz4740_udc_start(struct usb_gadget_driver *driver,
417420        int (*bind)(struct usb_gadget *))
418421{
419422    struct jz4740_udc *dev = &jz4740_udc_controller;
...... 
450453
451454    return 0;
452455}
453EXPORT_SYMBOL(usb_gadget_probe_driver);
454456
455457static void stop_activity(struct jz4740_udc *dev,
456458              struct usb_gadget_driver *driver)
...... 
489491/*
490492 * Unregister entry point for the peripheral controller driver.
491493 */
492int usb_gadget_unregister_driver(struct usb_gadget_driver *driver)
494static int jz4740_udc_stop(struct usb_gadget_driver *driver)
493495{
494496    struct jz4740_udc *dev = &jz4740_udc_controller;
495497    unsigned long flags;
...... 
516518    return 0;
517519}
518520
519EXPORT_SYMBOL(usb_gadget_unregister_driver);
520
521521/*-------------------------------------------------------------------------*/
522522
523523/** Write request to FIFO (max write == maxp size)
...... 
19361936    .get_frame = jz4740_udc_get_frame,
19371937    .wakeup = jz4740_udc_wakeup,
19381938    .pullup = jz4740_udc_pullup,
1939    .start = jz4740_udc_start,
1940    .stop = jz4740_udc_stop,
19391941};
19401942
19411943static struct usb_ep_ops jz4740_ep_ops = {
...... 
20872089    jz4740_udc->irq = platform_get_irq(pdev, 0);
20882090    ret = request_irq(jz4740_udc->irq, jz4740_udc_irq, 0, pdev->name,
20892091    jz4740_udc);
2090        if (ret) {
2091                dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
2092                goto err_iounmap;
2092    if (ret) {
2093        dev_err(&pdev->dev, "Failed to request irq: %d\n", ret);
2094        goto err_iounmap;
2095    }
2096
2097    ret = usb_add_gadget_udc(&pdev->dev, &jz4740_udc->gadget);
2098    if (ret) {
2099        dev_err(&pdev->dev, "Failed to add gadget: %d\n", ret);
2100        goto err_free_irq;
20932101    }
20942102
20952103    udc_disable(jz4740_udc);
...... 
20972105
20982106    return 0;
20992107
2108err_free_irq:
2109    free_irq(jz4740_udc->irq, pdev);
21002110err_iounmap:
21012111    iounmap(jz4740_udc->base);
21022112err_release_mem_region:
...... 
21142124{
21152125    struct jz4740_udc *dev = platform_get_drvdata(pdev);
21162126
2127    usb_del_gadget_udc(&dev->gadget);
21172128    if (dev->driver)
21182129        return -EBUSY;
21192130

Archive Download the corresponding diff file



interactive