Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361243
b: refs/heads/master
c: 9992a99
h: refs/heads/master
i:
  361241: 9949ead
  361239: a1993b5
v: v3
  • Loading branch information
Felipe Balbi committed Mar 4, 2013
1 parent ffa8110 commit ed99ab8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7597a49b1e984bfb9930f832af963de1120d30e4
refs/heads/master: 9992a9979fd463903e1a34b68d609441f36bafd4
20 changes: 11 additions & 9 deletions trunk/drivers/usb/gadget/pxa25x_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1266,13 +1266,6 @@ static int pxa25x_udc_start(struct usb_gadget *g,
dev->gadget.dev.driver = &driver->driver;
dev->pullup = 1;

retval = device_add (&dev->gadget.dev);
if (retval) {
dev->driver = NULL;
dev->gadget.dev.driver = NULL;
return retval;
}

/* ... then enable host detection and ep0; and we're ready
* for set_configuration as well as eventual disconnect.
*/
Expand Down Expand Up @@ -1331,7 +1324,6 @@ static int pxa25x_udc_stop(struct usb_gadget*g,
dev->gadget.dev.driver = NULL;
dev->driver = NULL;

device_del (&dev->gadget.dev);
dump_state(dev);

return 0;
Expand Down Expand Up @@ -2146,6 +2138,13 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
dev->gadget.dev.parent = &pdev->dev;
dev->gadget.dev.dma_mask = pdev->dev.dma_mask;

retval = device_add(&dev->gadget.dev);
if (retval) {
dev->driver = NULL;
dev->gadget.dev.driver = NULL;
goto err_device_add;
}

the_controller = dev;
platform_set_drvdata(pdev, dev);

Expand Down Expand Up @@ -2196,6 +2195,8 @@ static int __init pxa25x_udc_probe(struct platform_device *pdev)
free_irq(irq, dev);
#endif
err_irq1:
device_unregister(&dev->gadget.dev);
err_device_add:
if (gpio_is_valid(dev->mach->gpio_pullup))
gpio_free(dev->mach->gpio_pullup);
err_gpio_pullup:
Expand All @@ -2217,10 +2218,11 @@ static int __exit pxa25x_udc_remove(struct platform_device *pdev)
{
struct pxa25x_udc *dev = platform_get_drvdata(pdev);

usb_del_gadget_udc(&dev->gadget);
if (dev->driver)
return -EBUSY;

usb_del_gadget_udc(&dev->gadget);
device_unregister(&dev->gadget.dev);
dev->pullup = 0;
pullup(dev);

Expand Down

0 comments on commit ed99ab8

Please sign in to comment.