[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220705131951.1388968-1-michael@walle.cc>
Date:   Tue,  5 Jul 2022 15:19:50 +0200
From:   Michael Walle <michael@...le.cc>
To:     Cristian Birsan <cristian.birsan@...rochip.com>,
        Felipe Balbi <balbi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Alexandre Belloni <alexandre.belloni@...tlin.com>,
        Claudiu Beznea <claudiu.beznea@...rochip.com>
Cc:     Saravana Kannan <saravanak@...gle.com>,
        linux-arm-kernel@...ts.infradead.org, linux-usb@...r.kernel.org,
        linux-kernel@...r.kernel.org, Michael Walle <michael@...le.cc>
Subject: [PATCH 1/2] 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: Michael Walle <michael@...le.cc>
---
 drivers/usb/gadget/udc/atmel_usba_udc.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index ae2bfbac603e..48355e0cee76 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -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;
-- 
2.30.2
Powered by blists - more mailing lists
 
