Skip to content

Commit

Permalink
usb: gadget: udc: atmel: check rc of devm_gpiod_get_optional()
Browse files Browse the repository at this point in the history
devm_gpiod_get_optional() might still return an error code, esp.
EPROBE_DEFER. Return any errors.

Signed-off-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220705131951.1388968-1-michael@walle.cc
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Michael Walle authored and Greg Kroah-Hartman committed Jul 8, 2022
1 parent 14a6043 commit e89676f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/usb/gadget/udc/atmel_usba_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
GPIOD_IN);
if (IS_ERR(udc->vbus_pin))
return ERR_CAST(udc->vbus_pin);

if (fifo_mode == 0) {
udc->num_ep = udc_config->num_ep;
Expand Down

0 comments on commit e89676f

Please sign in to comment.