From: Jean-Christophe PLAGNIOL-VILLARD Date: Mon, 20 Sep 2010 16:31:07 +0000 (+0200) Subject: USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=969affff54702785330de553b790372e261e93f9;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git USB: atmel_usba_udc: force vbus_pin at -EINVAL when gpio_request failled to ensure gpio_is_valid return false Signed-off-by: Nicolas Ferre Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/atmel_usba_udc.c b/drivers/usb/gadget/atmel_usba_udc.c index e4810c6a0b1f..b5e20e873cba 100644 --- a/drivers/usb/gadget/atmel_usba_udc.c +++ b/drivers/usb/gadget/atmel_usba_udc.c @@ -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; } }