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>
Fri, 22 Oct 2010 17:21:47 +0000 (10:21 -0700)
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>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/gadget/atmel_usba_udc.c

index e4810c6a0b1f935961f33f0fedaff60b337390ac..b5e20e873cbad09bbebb7134929cf97880532bea 100644 (file)
@@ -2015,6 +2015,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;
                }
        }