spin_lock(&udc->lock);
- /* May happen if Vbus pin toggles during probe() */
- if (!udc->driver)
- goto out;
-
vbus = vbus_is_present(udc);
if (vbus != udc->vbus_prev) {
if (vbus) {
udc->vbus_prev = vbus;
}
-out:
spin_unlock(&udc->lock);
return IRQ_HANDLED;
if (gpio_is_valid(udc->vbus_pin)) {
if (!devm_gpio_request(&pdev->dev, udc->vbus_pin, "atmel_usba_udc")) {
+ irq_set_status_flags(gpio_to_irq(udc->vbus_pin),
+ IRQ_NOAUTOEN);
ret = devm_request_irq(&pdev->dev,
gpio_to_irq(udc->vbus_pin),
usba_vbus_irq, 0,
dev_warn(&udc->pdev->dev,
"failed to request vbus irq; "
"assuming always on\n");
- } else {
- disable_irq(gpio_to_irq(udc->vbus_pin));
}
} else {
/* gpio_request fail so use -EINVAL for gpio_is_valid */