diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2010-09-20 18:31:07 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-22 10:47:37 -0800 |
commit | 1ec2786c5c25810f5592288353cab37dd0517793 (patch) | |
tree | e8f31bf7381b3782d0c1348811e2880b6255c69d /drivers/usb/gadget | |
parent | 4dadf0b4ec84ac2aedf887ac63bb2ba09cfc27c7 (diff) | |
download | lwn-1ec2786c5c25810f5592288353cab37dd0517793.tar.gz lwn-1ec2786c5c25810f5592288353cab37dd0517793.zip |
USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled
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>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/atmel_usba_udc.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index 4e970cf0e29a..23d4ce372a47 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -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; } } |