Commit e89676f6 authored by Michael Walle's avatar Michael Walle Committed by Greg Kroah-Hartman

usb: gadget: udc: atmel: check rc of devm_gpiod_get_optional()

devm_gpiod_get_optional() might still return an error code, esp.
EPROBE_DEFER. Return any errors.
Signed-off-by: default avatarMichael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220705131951.1388968-1-michael@walle.ccSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 14a60433
...@@ -2165,6 +2165,8 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev, ...@@ -2165,6 +2165,8 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
udc->vbus_pin = devm_gpiod_get_optional(&pdev->dev, "atmel,vbus", udc->vbus_pin = devm_gpiod_get_optional(&pdev->dev, "atmel,vbus",
GPIOD_IN); GPIOD_IN);
if (IS_ERR(udc->vbus_pin))
return ERR_CAST(udc->vbus_pin);
if (fifo_mode == 0) { if (fifo_mode == 0) {
udc->num_ep = udc_config->num_ep; udc->num_ep = udc_config->num_ep;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment