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 18:47:37 +0000 (10:47 -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 4e970cf0e29ae364b34c5e7436906e95db313952..23d4ce372a472d9e1a3a9e38599214e4965cb3ae 100644 (file)
@@ -2013,6 +2013,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;
                }
        }