diff options
Diffstat (limited to 'drivers/usb/gadget/udc/bcm63xx_udc.c')
-rw-r--r-- | drivers/usb/gadget/udc/bcm63xx_udc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 2235b8808700..c790918b337b 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c | |||
@@ -1836,8 +1836,7 @@ static int bcm63xx_udc_start(struct usb_gadget *gadget, | |||
1836 | * @gadget: USB slave device. | 1836 | * @gadget: USB slave device. |
1837 | * @driver: Driver for USB slave devices. | 1837 | * @driver: Driver for USB slave devices. |
1838 | */ | 1838 | */ |
1839 | static int bcm63xx_udc_stop(struct usb_gadget *gadget, | 1839 | static int bcm63xx_udc_stop(struct usb_gadget *gadget) |
1840 | struct usb_gadget_driver *driver) | ||
1841 | { | 1840 | { |
1842 | struct bcm63xx_udc *udc = gadget_to_udc(gadget); | 1841 | struct bcm63xx_udc *udc = gadget_to_udc(gadget); |
1843 | unsigned long flags; | 1842 | unsigned long flags; |
@@ -1963,7 +1962,7 @@ static irqreturn_t bcm63xx_udc_ctrl_isr(int irq, void *dev_id) | |||
1963 | { | 1962 | { |
1964 | struct bcm63xx_udc *udc = dev_id; | 1963 | struct bcm63xx_udc *udc = dev_id; |
1965 | u32 stat; | 1964 | u32 stat; |
1966 | bool disconnected = false; | 1965 | bool disconnected = false, bus_reset = false; |
1967 | 1966 | ||
1968 | stat = usbd_readl(udc, USBD_EVENT_IRQ_STATUS_REG) & | 1967 | stat = usbd_readl(udc, USBD_EVENT_IRQ_STATUS_REG) & |
1969 | usbd_readl(udc, USBD_EVENT_IRQ_MASK_REG); | 1968 | usbd_readl(udc, USBD_EVENT_IRQ_MASK_REG); |
@@ -1991,7 +1990,7 @@ static irqreturn_t bcm63xx_udc_ctrl_isr(int irq, void *dev_id) | |||
1991 | 1990 | ||
1992 | udc->ep0_req_reset = 1; | 1991 | udc->ep0_req_reset = 1; |
1993 | schedule_work(&udc->ep0_wq); | 1992 | schedule_work(&udc->ep0_wq); |
1994 | disconnected = true; | 1993 | bus_reset = true; |
1995 | } | 1994 | } |
1996 | if (stat & BIT(USBD_EVENT_IRQ_SETUP)) { | 1995 | if (stat & BIT(USBD_EVENT_IRQ_SETUP)) { |
1997 | if (bcm63xx_update_link_speed(udc)) { | 1996 | if (bcm63xx_update_link_speed(udc)) { |
@@ -2014,6 +2013,8 @@ static irqreturn_t bcm63xx_udc_ctrl_isr(int irq, void *dev_id) | |||
2014 | 2013 | ||
2015 | if (disconnected && udc->driver) | 2014 | if (disconnected && udc->driver) |
2016 | udc->driver->disconnect(&udc->gadget); | 2015 | udc->driver->disconnect(&udc->gadget); |
2016 | else if (bus_reset && udc->driver) | ||
2017 | usb_gadget_udc_reset(&udc->gadget, udc->driver); | ||
2017 | 2018 | ||
2018 | return IRQ_HANDLED; | 2019 | return IRQ_HANDLED; |
2019 | } | 2020 | } |
@@ -2324,10 +2325,8 @@ static int bcm63xx_udc_probe(struct platform_device *pdev) | |||
2324 | int rc = -ENOMEM, i, irq; | 2325 | int rc = -ENOMEM, i, irq; |
2325 | 2326 | ||
2326 | udc = devm_kzalloc(dev, sizeof(*udc), GFP_KERNEL); | 2327 | udc = devm_kzalloc(dev, sizeof(*udc), GFP_KERNEL); |
2327 | if (!udc) { | 2328 | if (!udc) |
2328 | dev_err(dev, "cannot allocate memory\n"); | ||
2329 | return -ENOMEM; | 2329 | return -ENOMEM; |
2330 | } | ||
2331 | 2330 | ||
2332 | platform_set_drvdata(pdev, udc); | 2331 | platform_set_drvdata(pdev, udc); |
2333 | udc->dev = dev; | 2332 | udc->dev = dev; |