Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3508667rwb; Mon, 5 Sep 2022 13:03:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR57T+jUxFGxSpGSdCRnIp+KsdH7nnuPtsxPQpQPrC5RuRz1Nxu4/wmF4ueZk9JuNe3BeLYd X-Received: by 2002:a17:90b:4d12:b0:1f5:5af8:c093 with SMTP id mw18-20020a17090b4d1200b001f55af8c093mr21757081pjb.33.1662408179789; Mon, 05 Sep 2022 13:02:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662408179; cv=none; d=google.com; s=arc-20160816; b=wUkNg4dfEGFZpbu7L3WKjjwSZFACGGCDpcDoAd4Brkd/z6z3zIn8vBvQm+11QhVzOB N6gxYPC6Z17JKO5tdvwkrN7CU+CMBz+fU1zp/Ug/5xQz2CmAlyrRbIfmiXaoY93ZxPCq tsSTR1IC9uLyiC60i88E5MHQHAnmCxkuwIjoQdED1Ml1QSyD4bcfQyscgjaheJ6sdUJz HJOHeqz/KntpfFysZY8OoF08rF/Za4kEJLa4lc+qVAVst9bGkgsiES76G9K8vHRU/19B o2g6Qg2ukEOAZn+noAPVhJHCPbjCb4LAzHj2l0YK2to52q7x385A0V+RTcX88zMncssu 3xrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=y3Qjjf92TYynwevE3H2ZfJzfWM4V6u0gYdLfjE+80ak=; b=ufxS4LytdthCQTRpENbqAz/88agrtHR6SCqJYUH6L6ySe+f+Zs8ZJL015pThPf7Exh xKgP8GQb3bpkS9S9ueM4mkosdB4M7w4CKNcUvJ7AZHMRkNCgouP8o3zQUTl3aJjdaj5m 2IHyce8tF1tEpHn5JjRy350qsr5ptD4edpjIQVLMq3LTCMnAXKqrRTL1Mc10HLSfskhk qE8gCemgDNg5pZ02kUX0/yk393rBaqqXaw1p/dSL4QgSLBx0Inng9pfOp+nR7DR1LDAZ oSOGL4Q0fn+XdxZrOmES29x2yE4GE9q0Z8tnThz533p9RNEv+SCRkaSt3p0s2PsP/f2J CxRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=p8fQjE0a; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 28-20020a17090a019c00b0020087bc6415si1904896pjc.16.2022.09.05.13.02.48; Mon, 05 Sep 2022 13:02:59 -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=@gmail.com header.s=20210112 header.b=p8fQjE0a; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230036AbiIETvs (ORCPT + 99 others); Mon, 5 Sep 2022 15:51:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiIETvq (ORCPT ); Mon, 5 Sep 2022 15:51:46 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCBD9102A; Mon, 5 Sep 2022 12:51:44 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id o4so9175743pjp.4; Mon, 05 Sep 2022 12:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=y3Qjjf92TYynwevE3H2ZfJzfWM4V6u0gYdLfjE+80ak=; b=p8fQjE0a0ZYjZfKRTjHpT3euYQsGr97PlI4J+3Etag+6i4rW86Bv40nzZOUk7I+O74 6AB3V55fbqVv7uRxcLJ9p+i6cEGfvUhY3Kul9eRBDmP4APZA6HSJroq5lt4nanlf+S4D WzL8qbprYpzsZPbHTw91TVqhBBtGkTVEuU+NWJvf9meD6jRYOhrvpxBh2bEHlWS2vOzN /mMdK+1vtePGkD0+o2tcKMw1L7TbtR/LY2u3VdsMAB8lgT9qdQtRVvzA9MzGS4jTHM2e Y8DXi1ZE+gjUnF3/4YvRqKEtHb92EDRaHq/IKZmP1TBDcFx5o+n/mIkQoIp34EalsnaQ zoGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=y3Qjjf92TYynwevE3H2ZfJzfWM4V6u0gYdLfjE+80ak=; b=65jBx1SPF8ACMmQQMnnL1NYV4PW0trSkojJeIJcn2ybZ2YqAmYtOeSjqlUZ6HVOkG0 UdLTc5EWYIigTiAvlG8+QPqKrSklmDW1GJ+h3mYTkxlLSWvKqtQ+L+PF6A71Zoneu8Hf VNUA+4bLYfFczaH6FQF/wI/Ozp6HSAMNKZwDtzqGRko6Rvq19umG0NOgLjRMw2jQcYez eyHQDvl6YqgQORUiAbRX9QYKHbdSR7VpviOObmZrY/VvaspNczM7pmpCDSgdN1NWVJqE o4Ftltve40Jwgoy3uxDPV9qkAcs4g+bc1TULDCXoP/NYVGqIqb9EOrkeQErCM9FgvK4c GXzA== X-Gm-Message-State: ACgBeo1asBlZBe8ebSID/OV4QWG3fm7cXOfxvyZxhBQKaR8efjhKF81D AIjbT4nBTuvnLzwLq1lcXNkUKsFFn/Q= X-Received: by 2002:a17:902:f68d:b0:16f:2314:7484 with SMTP id l13-20020a170902f68d00b0016f23147484mr49230641plg.136.1662407504235; Mon, 05 Sep 2022 12:51:44 -0700 (PDT) Received: from google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id g5-20020a17090adac500b001fd8316db51sm7191722pjx.7.2022.09.05.12.51.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 12:51:43 -0700 (PDT) Date: Mon, 5 Sep 2022 12:51:39 -0700 From: Dmitry Torokhov To: Andy Shevchenko Cc: Thierry Reding , Mark Brown , Matti Vaittinen , Lorenzo Pieralisi , Claudiu Beznea , Liam Girdwood , Wim Van Sebroeck , Greg Kroah-Hartman , Guenter Roeck , Miquel Raynal , Linus Walleij , Felipe Balbi , Alexandre Belloni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Vignesh Raghavendra , Daniel Vetter , Thomas Petazzoni , Alexandre Torgue , Marc Zyngier , Richard Weinberger , David Airlie , Nicolas Ferre , Alyssa Rosenzweig , Bartosz Golaszewski , Jonathan Hunter , Rob Herring , Maxime Coquelin , Bjorn Helgaas , Pali =?iso-8859-1?Q?Roh=E1r?= , LINUXWATCHDOG , USB , "open list:GPIO SUBSYSTEM" , linux-pci , linux-tegra , "open list:MEMORY TECHNOLOGY..." , Linux Kernel Mailing List , dri-devel , linux-stm32@st-md-mailman.stormreply.com, linux-arm Mailing List Subject: Re: [PATCH v1 04/11] usb: phy: tegra: switch to using devm_gpiod_get() Message-ID: References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> <20220903-gpiod_get_from_of_node-remove-v1-4-b29adfb27a6c@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 On Mon, Sep 05, 2022 at 10:41:40PM +0300, Andy Shevchenko wrote: > On Mon, Sep 5, 2022 at 10:40 PM Dmitry Torokhov > wrote: > > On Mon, Sep 05, 2022 at 01:59:44PM +0300, Andy Shevchenko wrote: > > > On Mon, Sep 5, 2022 at 9:32 AM Dmitry Torokhov > > > wrote: > > ... > > > > > - gpiod = devm_gpiod_get_from_of_node(&pdev->dev, np, > > > > - "nvidia,phy-reset-gpio", > > > > - 0, GPIOD_OUT_HIGH, > > > > - "ulpi_phy_reset_b"); > > > > + gpiod = devm_gpiod_get(&pdev->dev, "nvidia,phy-reset", > > > > + GPIOD_OUT_HIGH); > > > > err = PTR_ERR_OR_ZERO(gpiod); > > > > > > What does _OR_ZERO mean now? > > > > This converts a pointer to an error code if a pointer represents > > ERR_PTR() encoded error, or 0 to indicate success. > > Yes, I know that. My point is, how is it useful now (or even before)? > I mean that devm_gpio_get() never returns NULL, right? What does returning NULL have to do with anything. It converts a pointer to a "classic" return code, with negative errors and 0 on success. It allows to not use multiple IS_ERR/PTR_ERR in the code (I'd need 1 IS_ERR and 2 PTR_ERR, one in dev_err() and another to return). Thanks. -- Dmitry