Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1327316imw; Tue, 5 Jul 2022 07:36:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tXuGVui9v+5CMjWfiiaRhhO/ZO9v8ynicHbBuzuln7K6jFdSPKg/NBvZqH4ehfmn9K+ry7 X-Received: by 2002:a17:906:2c12:b0:726:94a0:2708 with SMTP id e18-20020a1709062c1200b0072694a02708mr34175776ejh.179.1657031813212; Tue, 05 Jul 2022 07:36:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657031813; cv=none; d=google.com; s=arc-20160816; b=R9tykJGhwkVCIOau1L0VKGYcE0mkQkHq7r3CotLp3zGO1tITwNWRvxBG6J1h1LXHXc 5cbv2hgCIF08Z8rfwMSdgvYaYcXv1lgolQfctM+5FMK24uVdMeUC16Kp1DYzbPhkIXuk mDUI4AMcK/WH2IXGGdUotg5K03lrl5KKnSxIL7reODevqMuc6cyio3ehoEMs1oDMerUE yJN5YP8TEVxU8DOYxWiJ2Oc+12ER1dGtMKi9Z9qlXOC+sq1wuWmprMK0aaBo++k0CTYO pqgh02e2kTHLQ27UjR0yX8kFIvNWQOOHFxJ45HSOzgLPFueQ36TQuNOXcI/H97LeY+to vmEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3lqEEC/xkItTOFsnReNMLLF51q2VVvTpLLXaoFEIVV4=; b=LwO9Z/3lugnD1otQbsKrE2AAGYMZz79KYrsjLksSuk/K2FBw5PcofLxvpKFtFyT3Sq dLqRSHaFR2nhhh1TxdevCdUR6/bc140K+IskftyZuyH1LQzrMeG9rmlVBuAis3QmlCvm racb2sl8Sibw2B3JdRYanWdmxtzgITyNM1UVEIMSc2L72dg82LstqJuOkAz0WK9qDeLp tqUig8BbqDEvZkSV6EylKlwlTEW3krZUEMIOWbFWYWdOvSWoX4oB9u4Wt2zA1gNY01Ci Gs89fE3mUPIHNv1UA+WdbMgPgV3v5xMUN9J0Xt4+/4tjSqZ1JexcP5+Ah5KUmHU3v6U6 aL6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=s9oo3vRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hj1-20020a1709069fc100b0072846e4d504si550536ejc.447.2022.07.05.07.36.28; Tue, 05 Jul 2022 07:36:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=s9oo3vRu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232089AbiGENtM (ORCPT + 99 others); Tue, 5 Jul 2022 09:49:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232385AbiGENsr (ORCPT ); Tue, 5 Jul 2022 09:48:47 -0400 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D4D520BEF; Tue, 5 Jul 2022 06:19:59 -0700 (PDT) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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; -- 2.30.2