]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Mon, 20 Sep 2010 16:31:07 +0000 (18:31 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 22 Nov 2010 19:00:00 +0000 (11:00 -0800)
commit 969affff54702785330de553b790372e261e93f9 upstream.

to ensure gpio_is_valid return false

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/atmel_usba_udc.c

index d623c7bda1f610741dce00ee3ab0216cccc19303..959f0624fe0dc5864b15a7d18c181f29a4cbe034 100644 (file)
@@ -2014,6 +2014,9 @@ static int __init usba_udc_probe(struct platform_device *pdev)
                        } else {
                                disable_irq(gpio_to_irq(udc->vbus_pin));
                        }
+               } else {
+                       /* gpio_request fail so use -EINVAL for gpio_is_valid */
+                       ubc->vbus_pin = -EINVAL;
                }
        }