From patchwork Tue Jul 5 13:19:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Walle X-Patchwork-Id: 12906575 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 86494C43334 for ; Tue, 5 Jul 2022 13:21:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=XgJfPgRrv/cQ5Mg7ARfU8fhBlO3T4zq3Nppicx50SXI=; b=ME0h5iEr2C2KTY worGIzKzEaiQnMY/0VRAz5CEL9wGyCwsMMyrjZ/r0lZ1GfdQp69shuiaTBaIrPG083+RRKvlhUly1 95Goq66HxJ/dYNyaZkBKt7xdySuT3DNFt2noVrkrWY+dshemurj8jZCME4d8DDYpb6VcSJRl8xBWK l1aaijbNQDVzEnW1NIuZd9WjXwaDFaB2+L8j9uMO/NTTuzL775C9zG6+/apHq7SrIcZYDPjNgqGhv Tc3UAFdont83oSNqB/3LVjfk7pHIn5AV7p+oTtn4nPoW1oPU0A7COl97fsgT16Ps4z48sG1BtXAZf TJrU3/QevW8MI5shZ9Wg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8iTD-000RyC-4B; Tue, 05 Jul 2022 13:20:03 +0000 Received: from ssl.serverraum.org ([2a01:4f8:151:8464::1:2]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o8iT9-000RwC-Qa for linux-arm-kernel@lists.infradead.org; Tue, 05 Jul 2022 13:20:01 +0000 Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 9DB962223E; Tue, 5 Jul 2022 15:19:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1657027197; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3lqEEC/xkItTOFsnReNMLLF51q2VVvTpLLXaoFEIVV4=; b=s9oo3vRuXgg9QFfaRK9nBtzUcWYb3DjJTCdaKYa/yIVKpNj2txEwDbwPbxES8FrnPQqayk h/vgED82LvsZ2+o3qXnohirS96GWEuIdW7kkFvToPqVlDuIGj1EZl68zrk4ZeSPznFEelS dKnmNjFamEjipD74cmDhpGM+S+x+KDE= From: Michael Walle To: Cristian Birsan , Felipe Balbi , Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea Cc: Saravana Kannan , linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Michael Walle Subject: [PATCH 1/2] usb: gadget: udc: atmel: check rc of devm_gpiod_get_optional() Date: Tue, 5 Jul 2022 15:19:50 +0200 Message-Id: <20220705131951.1388968-1-michael@walle.cc> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220705_062000_081973_19C43E5F X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org devm_gpiod_get_optional() might still return an error code, esp. EPROBE_DEFER. Return any errors. Signed-off-by: Michael Walle --- 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;