Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3508825rwb; Mon, 5 Sep 2022 13:03:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Y9CBMW1ActoGf5ZxXuGuWWenBTRP878BdMvXsCVjlP2zy4oDvuoM6JWx2BAnmUdap/UeT X-Received: by 2002:a17:907:e91:b0:741:a0a2:cbb8 with SMTP id ho17-20020a1709070e9100b00741a0a2cbb8mr25134696ejc.637.1662408186677; Mon, 05 Sep 2022 13:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662408186; cv=none; d=google.com; s=arc-20160816; b=CDAQdmvf04M5Q8z601yw04hE0iHnMIzpPwkZ0Hn57nDOr9jCQkjYo5YrxQp1Fw0k9/ yZr/39fyxTGkr5rNNsabRQXo3R156a1oy9IcQzTt6l9vl1VX9zaNhfhkrmvSArit8k/J T86WRwknySiGFGcVdjycN/LQfxy/d5FN2nX0uYwpzWyMlrsvLiidlu+jCvdHtj2qnYQW cCqnjJMqRYRd0HT4wYCXzdEEkS0Q4cv+XKpR7bz47RDuHw1V29VPhGdKPT7Vf4buuW3P DuGYx6ek2mDeKoJufc+DVIaqhP2cl7jFFdvbk9sqYxgshwLarej/XY3lHV9RZ++kgOSQ cfxw== 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=CBRkTEdupwBv7lUysuAAHCWeUeGOXoPs3goZlUKIChI=; b=O/sbS5cdegStUxC/WgrRResRN4uZFSGLZ0kfYvNEMNZ+S9HnCygXp/llMBFpmnZmv0 2R5e5FH3fxR6nwP9nU1YFS1IQcBRxwXMPkDwMCrMZ3z7siPCDrHpWpdA1CWtH0WjLhK7 PuqDxBi5ggvgaQ5KkQTTe7wTbd3gyCBnEXLgUENn6I0N4iZTA6JPkkwfniSioLpSKI8G TESSb+scfs9sNukoh9exqqH7nq2JTG0MuG5JZ+3rFarhHosDxgzmQe2Lka4LkDVpaIxb NMMjIKXpqQSLn2U7Dxq5HW/Cs7BqmFR5KCandOMdWFlJ0sS7kn+pM+Y4K3gxEoYxiUeC bNwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="AoB/BB+w"; 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 e8-20020a056402190800b0044eb0b5ca3dsi1622018edz.444.2022.09.05.13.02.41; Mon, 05 Sep 2022 13:03:06 -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="AoB/BB+w"; 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 S231721AbiIETkJ (ORCPT + 99 others); Mon, 5 Sep 2022 15:40:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231608AbiIETkF (ORCPT ); Mon, 5 Sep 2022 15:40:05 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7F2B286FF; Mon, 5 Sep 2022 12:40:04 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 78so8741810pgb.13; Mon, 05 Sep 2022 12:40:04 -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=CBRkTEdupwBv7lUysuAAHCWeUeGOXoPs3goZlUKIChI=; b=AoB/BB+wDCEOf3ollKTlkOpFH5ZdJcaYtYObH7F+USml96PL05nQZdIxn7ekRew/5b 7EIcLBlc3MsHwZ5Sf25zmIO3Px5fO4gvhdDaBRhf9uOzwFLARLpmd1bM870f8lIBNHD3 gytJZ2ifVtaupmJ3QTM9/NdK15W4dYwrMCBg6SW65U1OqgtNyXc84pbod89bIQ6BXjDU 8DjK9Glh1ftaKc4OO8CDr320e11XRL2oTkt0sdDZYfOg6PUIpHo4y/CMFZXvXzFkVUsb WSwJf6gJvfOXaQ8gaip6aWRNOqu2Fi4hdJAIEf0y3X+J6pOHAoM+5/JGDwZcC7JNH7er c8og== 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=CBRkTEdupwBv7lUysuAAHCWeUeGOXoPs3goZlUKIChI=; b=Pd1C8yk8nAtmUD5aDewV6uFkU9X7LFIDK9FEVBqbRLq6Bymdkwk6J9B56uy85QorVj NitnN2JRYc9FSlJyQVDjs737QWb3eKNB545Ooo5GicdY4/YbnbE2ordnYz5ywDuiNw1+ XMo6NFw6hUIq3h3sWfeIXXvK0MjRUgE/Wc4gbyubMFmtrjIQxaYxsVzktfT5R54lsLE7 YK+VZy89lq1RV5n6ku6s1+NB/9iyuSmYF49BuUlALqnMFY+m1EW4RWjEzIOZGZ3qlg5q 4CrCppbJsrfQLgEKRhm7uNn84+NJfEdyaOMuRJPHwwiIagCCjmAcdkdUV9it48VRlEoT eAWg== X-Gm-Message-State: ACgBeo39K1nVDiFwBj9ub+IelnML3OQhkva8SrppZdAaSAWkH9ajHdnx WmKEEu3QlY3qB3Z0E+qyb6BhAVhKZbE= X-Received: by 2002:a65:6255:0:b0:42c:87b1:485b with SMTP id q21-20020a656255000000b0042c87b1485bmr29214848pgv.491.1662406803892; Mon, 05 Sep 2022 12:40:03 -0700 (PDT) Received: from google.com ([2620:15c:202:201:7332:f188:2984:5930]) by smtp.gmail.com with ESMTPSA id p14-20020a170902780e00b00176b4f9d871sm2199498pll.70.2022.09.05.12.40.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 12:40:03 -0700 (PDT) Date: Mon, 5 Sep 2022 12:39:59 -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 01:59:44PM +0300, Andy Shevchenko wrote: > On Mon, Sep 5, 2022 at 9:32 AM Dmitry Torokhov > wrote: > > > > I would like to stop exporting OF-specific devm_gpiod_get_from_of_node() > > so that gpiolib can be cleaned a bit, so let's switch to the generic > > device property API. > > > > I believe that the only reason the driver, instead of the standard > > devm_gpiod_get(), used devm_gpiod_get_from_of_node() is because it > > wanted to set up a pretty consumer name for the GPIO, and we now have > > a special API for that. > > ... > > > - 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. static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr) { if (IS_ERR(ptr)) return PTR_ERR(ptr); else return 0; } Thanks. -- Dmitry