Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1612485imw; Tue, 5 Jul 2022 12:21:09 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tSuMMKS4kbphDIvNyG2qzZsXPyorSIUlv6NlpDJyQEpIilBG7nE4LUB1XBivPbnVukMIfn X-Received: by 2002:a63:4081:0:b0:405:4f9:e802 with SMTP id n123-20020a634081000000b0040504f9e802mr31386968pga.211.1657048869651; Tue, 05 Jul 2022 12:21:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657048869; cv=none; d=google.com; s=arc-20160816; b=C/SZ+crRkEPyBcg/ruGMO+hrY3HErXsgwiwNUPJWA7MhcU49yQGaB4UaWYK51qzVEZ zbAc/EJYTUazOCLrugrGHnl4l46upcJB9Xm40/aNn3B/RXD+E6aWc83Pw9RtuaNaE72i bGzzvgqiF1J0aZ8SQofj3eguBAbVQoU57u3UbGjDAMxhkZx//zfbPxwK+0whRJqyFaqo TbIglv/tLoB7ST1PjdwM34TwPbMQsZcisyccRC4wIVAu6QMqOf806uO5v1LRYCEQH0sq EvpgVFq5zfETMWpf0qmn0MbfQtl+Jk8Wxcop+JHZx0+Dhl9VeoxCJqBzzdBbJDkBJWGU 8bXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=kAczJeYcyqiN7KVfrRoJ6VQx+X3W9GuPya2JhuP15VI=; b=Kl0MA5w9xTC7Sxy9nwiuP+HJUp7cdOzxhTleLaZmBGfGak8krMyjIeAbGxn3y7Y4S1 E1iKGjgODOzBbHXUYfo5JvH5wES7x0pDDnHnYx9V3vdEAn6RsffKmv8YuZQT4/HliDeO 5XK//xfEt/LL8hEOIPouc/DOeaMx/SCwVoLj78yaC7n24va2oI+qzwTWvVrEEkjb6Pw0 e2qO3AxGROE+rUJ6LndBneUkfaG1t3555jlrldT+ijNBybivW7EXrHHkw9ZPbJr9mc50 7K8+shFuu47eMEwqDIQKzSY3EtcCSZofPA24pq1104Op/6QBkf9Y0xSotWlV0UYiUgvs 1BXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=sbHLfy93; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k137-20020a633d8f000000b003fdfb59ccdesi47553524pga.841.2022.07.05.12.20.57; Tue, 05 Jul 2022 12:21:09 -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=@google.com header.s=20210112 header.b=sbHLfy93; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232243AbiGESy3 (ORCPT + 99 others); Tue, 5 Jul 2022 14:54:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232564AbiGESy1 (ORCPT ); Tue, 5 Jul 2022 14:54:27 -0400 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B2913193FF for ; Tue, 5 Jul 2022 11:54:26 -0700 (PDT) Received: by mail-yb1-xb33.google.com with SMTP id 64so14179084ybt.12 for ; Tue, 05 Jul 2022 11:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kAczJeYcyqiN7KVfrRoJ6VQx+X3W9GuPya2JhuP15VI=; b=sbHLfy93zxO2jZlP14NUpxtJ70FHu6NB6T/IG9mWcGv5tfhayAmByj16/gfW2JJTLC pwyvgs/RB61a6y96htxrZJJCiCC+gTgfX4IpEfFg4cWaGCrvWy9f5O2wArdLz7xj1f/i DBJmC+SVM8qssWKoDUyp9xlh7DJ71g1ZZoT2kvYWsw6St9QatNK6VIdsHoFiXdUE8Jm+ Yr6b5hUPYoG2NCXC6tn2l/5IKo1CTn7+GyY2egqgrDq6tPg7FU67vgtpUM1dRuktkEV9 3QdX1xtQ2/GXBamSZ/4lzmX+0FdGDd9F5PUYZ7MWzrEbBEE9IKJxQCmSH5KKKUAYj5dp sKhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kAczJeYcyqiN7KVfrRoJ6VQx+X3W9GuPya2JhuP15VI=; b=x34oxP0B4c/pTIiLDWHjo6FfAds7bJogxFZZg48Bn8Huq7yioi6CaxH2i9B5w4oemD QubNCpPq7t0APBrGN84Jmygb/RAXWLteZQgmuT9A9G3ONJOZ2LtVKGizJbLFLmOiLtrW QG8Yv4X1VJL2p1250N2r+M3tedh+DK3z/iHkWM5hrllmAGG328w6uGm6E6SrRXQONJp/ an+Ml6BhZoJfg0c/oTVoj7t3hmwlQZw01TYy1l4zxLVJByw+W0Erp5wCsrh3UpMRYU9/ 4x2iLG0MVtUIDYxcASLObfeJHWJJXxbUCtC/bcBRICrnKzxpbcF584u0HNsKgyXREPZE jbYA== X-Gm-Message-State: AJIora9oZoH3PiiN46zFFNDnklm6eSSjNvPIwtAbqwGG83OHLK6X3q6z ZdhVqpu0LJehLe/GsKPmsFP7LQpmEreojDrH+rM2Pw== X-Received: by 2002:a25:9947:0:b0:663:ec43:61eb with SMTP id n7-20020a259947000000b00663ec4361ebmr39017812ybo.115.1657047265825; Tue, 05 Jul 2022 11:54:25 -0700 (PDT) MIME-Version: 1.0 References: <20220705131951.1388968-1-michael@walle.cc> In-Reply-To: <20220705131951.1388968-1-michael@walle.cc> From: Saravana Kannan Date: Tue, 5 Jul 2022 11:53:49 -0700 Message-ID: Subject: Re: [PATCH 1/2] usb: gadget: udc: atmel: check rc of devm_gpiod_get_optional() To: Michael Walle Cc: Cristian Birsan , Felipe Balbi , Greg Kroah-Hartman , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 On Tue, Jul 5, 2022 at 6:19 AM Michael Walle wrote: > > 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); I'm confused. Is it really an optional resource if you treat a failure to get it as a reason to fail a probe? -Saravana > > if (fifo_mode == 0) { > udc->num_ep = udc_config->num_ep; > -- > 2.30.2 >