Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1954419imw; Tue, 5 Jul 2022 19:33:52 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sL4Iiac+5thaFdiZrhGpSrGhhV5OSKklGDPZYY8+rruOAUSles3ge15t/sFY2gc/4Hz3g6 X-Received: by 2002:a17:902:bb95:b0:169:4d7:fee with SMTP id m21-20020a170902bb9500b0016904d70feemr44418745pls.80.1657074832115; Tue, 05 Jul 2022 19:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657074832; cv=none; d=google.com; s=arc-20160816; b=u+7f2vZYG0+oTxuvYpHBj339hRWe/IqftSzhFRgdPbbQ8UOxf09EMTfbaJVJlNiqdA BbvdenVCZO+X1L3zNvUbS7Q6BEGUXayZwHWteiouqfimoayCc4dwY6VyNmoeYbQdWbuy v9jJfUXwyJjS3tlOUOi0gXmbnHFDXeBsL5zR/KTX1ADYyi/I04v/DQH//2/gS7hv59H9 FZ0pWcdaUZwKJ+mKa/6RJzEGblZi/vCcmpj1uADOxEL/bvA611rpouyalajYtVhvuzvr O0+IWh8xgltq65r90lwonlcn3+eEfhtKwpn0vzjfriBj3zgBfpuTShzfcVvRu8i2/Bhw YENw== 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=v16gTYqXX7Kmo1KvNsCtNgX5ZllD8C1dx9oSGDIh2w4=; b=UiHTGWZGJPTGjN3iV4y2ffkZcpo4B5O9JVSxGh3mAGg7PI7FBnA4u6z6XU0+GvODYa 5HsugwDYU0jQke6UHwMKpO2cZE/2JVn8Is2mwur6OOBAPkSZt23C3G8ko2YVFhplzGlS ZiTRBkN+4C4JtabcEHkVLlmjR/TbIcSJ9J1nZTR3rzLVXqTQSUHojOiUqENLrU6rEpgA 07ST2pXN/Wj2Crqc42sz+u+eckZl3mj56tkc8et/ujH5RxYmXxml+IUVvu9HVk5dQNCs F7wQCwe/f10p3+Kb4HV9sSb1ckead2Uwl/z8iqkRoY0F+s+z/Py4JCKpabAA2UXct1Lr MmCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=qExZIdQl; 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 n20-20020a170902969400b001562b0bf47bsi18615807plp.58.2022.07.05.19.33.40; Tue, 05 Jul 2022 19:33:52 -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=qExZIdQl; 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 S229522AbiGFCZX (ORCPT + 99 others); Tue, 5 Jul 2022 22:25:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59832 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229507AbiGFCZV (ORCPT ); Tue, 5 Jul 2022 22:25:21 -0400 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 561E0B86F for ; Tue, 5 Jul 2022 19:25:17 -0700 (PDT) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-31c89653790so75597797b3.13 for ; Tue, 05 Jul 2022 19:25:17 -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=v16gTYqXX7Kmo1KvNsCtNgX5ZllD8C1dx9oSGDIh2w4=; b=qExZIdQlChbVTBQMag2KMz96xQQWol3P20ZUeAIElxpP8YUTld11yydHChd5fVamnM N+5qpsotZzK0TkuuZ6IizCnl7c+4ebPILh1/soI6S7VgHfeLOBQkjpt4QkW3rb7TgQc3 8Y1fBCsxkPnLvc8vUZLAQogjKTeYj5TI0mcLH7Fl5wPK008CHWLhfNWmJM//dGY59H7c SWa55+sGIdonk37XYCC33l3Rlwjqj3eaxLINcgOyLpKBPOvG7/rJprMVpcY5Yk6lk05G LKGuXAgm/AjvU+Y3IiVLZO8DD2khUxrD9ft8LKuN+OCzAUQa9x9mD7Fpt3lejxezx8gY c1+Q== 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=v16gTYqXX7Kmo1KvNsCtNgX5ZllD8C1dx9oSGDIh2w4=; b=lMwg142EWzuMsjFZeBY8bEo8mL/BYBvKGguke3JC7YiUcjIdnecu/zEVqMCbbzjM3R 7r3CvfRVLfkznlJogk0pyBgr97K8F9D0h3+3i5Qk08M7mYoaNWCS1J1rVxVqOhQJzSB4 ttpUyfVLumPMz1z6y3izp6U9PlrNoIC+y5SzSTnJ4Y4wxl8Lma1uB6WMSwxf+8/jldFP MGLTiP/2y8H0jlN1y2yMNkdr3ZHov05UXm6zfLk1aJCQayT+Fcr5UEmpUgICwmj7PwrP WjTzHLfxrCPXLUVDWCCJuMKKxOfg45sni8i2I8Q5i9elcy/8p5Sfrc3aWEnXdnDJ7XLk gVmA== X-Gm-Message-State: AJIora+GdHhawHh5U3n3Ghq1uNDCDDsYzmVYdZ0wcvMCNYjlDDhFir4b WiOsuw/B8/6/+ymaFexPA0sajDWE7bGIkr/F9yDymA== X-Received: by 2002:a81:34c:0:b0:31c:8b37:6595 with SMTP id 73-20020a81034c000000b0031c8b376595mr18858230ywd.126.1657074316081; Tue, 05 Jul 2022 19:25:16 -0700 (PDT) MIME-Version: 1.0 References: <20220705131951.1388968-1-michael@walle.cc> <7673314425958a56a07899b300226554@walle.cc> In-Reply-To: <7673314425958a56a07899b300226554@walle.cc> From: Saravana Kannan Date: Tue, 5 Jul 2022 19:24:39 -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 1:56 PM Michael Walle wrote: > > Am 2022-07-05 20:53, schrieb Saravana Kannan: > > 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? > > If the gpio isn't found NULL is returned. Ah, ok. -Saravana