aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget/at91_udc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/gadget/at91_udc.c')
-rw-r--r--drivers/usb/gadget/at91_udc.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c
index 45dd2929a671..a690d64217f4 100644
--- a/drivers/usb/gadget/at91_udc.c
+++ b/drivers/usb/gadget/at91_udc.c
@@ -1631,7 +1631,6 @@ static int at91_start(struct usb_gadget *gadget,
1631 1631
1632 udc = container_of(gadget, struct at91_udc, gadget); 1632 udc = container_of(gadget, struct at91_udc, gadget);
1633 udc->driver = driver; 1633 udc->driver = driver;
1634 udc->gadget.dev.driver = &driver->driver;
1635 udc->gadget.dev.of_node = udc->pdev->dev.of_node; 1634 udc->gadget.dev.of_node = udc->pdev->dev.of_node;
1636 udc->enabled = 1; 1635 udc->enabled = 1;
1637 udc->selfpowered = 1; 1636 udc->selfpowered = 1;
@@ -1652,7 +1651,6 @@ static int at91_stop(struct usb_gadget *gadget,
1652 at91_udp_write(udc, AT91_UDP_IDR, ~0); 1651 at91_udp_write(udc, AT91_UDP_IDR, ~0);
1653 spin_unlock_irqrestore(&udc->lock, flags); 1652 spin_unlock_irqrestore(&udc->lock, flags);
1654 1653
1655 udc->gadget.dev.driver = NULL;
1656 udc->driver = NULL; 1654 udc->driver = NULL;
1657 1655
1658 DBG("unbound from %s\n", driver->driver.name); 1656 DBG("unbound from %s\n", driver->driver.name);
@@ -1780,13 +1778,7 @@ static int at91udc_probe(struct platform_device *pdev)
1780 DBG("clocks missing\n"); 1778 DBG("clocks missing\n");
1781 retval = -ENODEV; 1779 retval = -ENODEV;
1782 /* NOTE: we "know" here that refcounts on these are NOPs */ 1780 /* NOTE: we "know" here that refcounts on these are NOPs */
1783 goto fail0b; 1781 goto fail1;
1784 }
1785
1786 retval = device_register(&udc->gadget.dev);
1787 if (retval < 0) {
1788 put_device(&udc->gadget.dev);
1789 goto fail0b;
1790 } 1782 }
1791 1783
1792 /* don't do anything until we have both gadget driver and VBUS */ 1784 /* don't do anything until we have both gadget driver and VBUS */
@@ -1857,8 +1849,6 @@ fail3:
1857fail2: 1849fail2:
1858 free_irq(udc->udp_irq, udc); 1850 free_irq(udc->udp_irq, udc);
1859fail1: 1851fail1:
1860 device_unregister(&udc->gadget.dev);
1861fail0b:
1862 iounmap(udc->udp_baseaddr); 1852 iounmap(udc->udp_baseaddr);
1863fail0a: 1853fail0a:
1864 if (cpu_is_at91rm9200()) 1854 if (cpu_is_at91rm9200())
@@ -1892,8 +1882,6 @@ static int __exit at91udc_remove(struct platform_device *pdev)
1892 gpio_free(udc->board.vbus_pin); 1882 gpio_free(udc->board.vbus_pin);
1893 } 1883 }
1894 free_irq(udc->udp_irq, udc); 1884 free_irq(udc->udp_irq, udc);
1895 device_unregister(&udc->gadget.dev);
1896
1897 iounmap(udc->udp_baseaddr); 1885 iounmap(udc->udp_baseaddr);
1898 1886
1899 if (cpu_is_at91rm9200()) 1887 if (cpu_is_at91rm9200())