Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3684258rwb; Mon, 5 Sep 2022 16:54:05 -0700 (PDT) X-Google-Smtp-Source: AA6agR4i2343zLQWKayXTajUiqq6d8o0gXGcNT6B6laa58f/tNbG/PHwITf1WLdiRRXt7BHjWGUU X-Received: by 2002:a17:902:e750:b0:176:b0fb:9683 with SMTP id p16-20020a170902e75000b00176b0fb9683mr6588036plf.71.1662422045340; Mon, 05 Sep 2022 16:54:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662422045; cv=none; d=google.com; s=arc-20160816; b=c29s8UOgte5cfVQw+T3fp2J273buPBKjmKZwCZ1npFGiJOiqJrbsl7sS2+agqjlxay EarZtUbbObRwjmtw1fWtTAsduE3zOLT5sOIGtIIeFrhCFzobjxdXFsqdqKj6AOJWrZEq /DBytCiQ/fz8QYHaFPV0Mprv6G6m2KYbMTzKkDhbki0d30Mmx9H8JP3KzklfJ839UISI 64nALkchg1ezxlPvW0MlYTdkRnoGBkYls6sv9a3l++MHS0uqnEINol8Z7+W5a1UxdKjk ZaYABwQjrBUhvMPA4d6dhJkNLy86BmVYW6g61WbLGIe3ss+T7c13kY4+2X0brgjm++g5 EWlw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=QRQkxIGFI3OF3amcRlbkZf4vgkek6ggFXyd9zidvB8c=; b=siSBLmwrfu7CLN9RvurrpiGioTRtKrBu9K78vbVmQaI/uXIJj2WgXs0xBHOiqN27DC ohQiSuIQagIuE20Bm7HiDb1loKT/JnAPvPcUoWv4ElpPf4oYW17tL+Xt4XVTukbr69Kd U8KfrA4tfxGgITl2mM9clxwLNOLB1QkQCNSIfgEDFCqeOcOrajI9v9YoOmWPCHdVsqzb u4SyMifHwjF/QP0qxc1Ehfd2XWDOSYyTaJUBkWZEpbZeAP7vguQdnHNLYhq8+1eNws0i L6ojztmzmfIK3h8eiJgxmAp4nye4IE6MigySmh/FI+gjKDxlxeEgkRg6nLbzyU/Qp1FM 6T9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gsorC9ci; 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 z10-20020a170902ccca00b00176955c81eesi7061819ple.247.2022.09.05.16.53.54; Mon, 05 Sep 2022 16:54:05 -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=gsorC9ci; 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 S232627AbiIEWzC (ORCPT + 99 others); Mon, 5 Sep 2022 18:55:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232960AbiIEWy7 (ORCPT ); Mon, 5 Sep 2022 18:54:59 -0400 Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE13F22B30; Mon, 5 Sep 2022 15:54:58 -0700 (PDT) Received: by mail-pj1-x1029.google.com with SMTP id fv3so3366158pjb.0; Mon, 05 Sep 2022 15:54:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date; bh=QRQkxIGFI3OF3amcRlbkZf4vgkek6ggFXyd9zidvB8c=; b=gsorC9ciDElqLq5gq0tq73oj5nMDX/AJm+EMEt5M9j7Nw6OucD0+TVGBzuQn+rrtls 0loRnw7UzHrgMM28KIGVLo7qn/bZoumg2qTw3CfDMDdQmf0bgbzpShi+kGjU7raGyx6P sToiGUYujxqPyCybICNsYdfYAa2jOurTif72VImXpZhCttvifys7wIqhFIW1PJR8dY03 UzvU99z5GubsoABcuAk5rbAMv44acUIXmY5P0ep133FiqLgOHtVg+wzuulxPweHG+ula IzdWZ5ta3aGiqrNbwgZATXaEEWNGQRgzb+HrP6NXzuvsc0zd1wPa546sY9tkILtVErqR hUbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=QRQkxIGFI3OF3amcRlbkZf4vgkek6ggFXyd9zidvB8c=; b=M/s7BGVStwTv9m1z4cz9YNSchNnSk3fSsWDH1/fgS2sWgVeZdVoC2nwqtt0CPiC/7K xRh8xEllVZMVWT67rD6tjFOeK9c/5s2kxu3snlB9r4WUd3IxbXXJAEfmzdkP8eyRTxb2 wNBnlIKZhsF+qIZfNq52SAqzFyu95VYuIE2c+Qr3qRg2kVr3tASNLPMAdBBC/Se02IqW ix6j3OKkc0Se3DtuMQtk8gANujy0aWN5KHACJAEGidhgzzY3KdGFiNfr+n+GIbYBcaVA HftmH7DY+OR4wSqDjJ/BYngSFkg3w/DEYgV15YIVyWz9KVNyhiPqRpMH11dbZf3o2tnk u3qQ== X-Gm-Message-State: ACgBeo3JaZi5sZV5UPunvS4jfAmDDqOyv2SpN9eiyZ24atF7DyPGd1s7 nzZ8dKH+axeq0Xn3NpZ2KUU= X-Received: by 2002:a17:902:be03:b0:175:6397:9425 with SMTP id r3-20020a170902be0300b0017563979425mr21493671pls.26.1662418498231; Mon, 05 Sep 2022 15:54:58 -0700 (PDT) Received: from google.com ([2620:15c:202:201:1190:fbfa:ae95:111c]) by smtp.gmail.com with ESMTPSA id d21-20020a630e15000000b0042c2def703asm6833366pgl.22.2022.09.05.15.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 15:54:57 -0700 (PDT) Date: Mon, 5 Sep 2022 15:54:53 -0700 From: Dmitry Torokhov To: Pali =?iso-8859-1?Q?Roh=E1r?= 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 , linux-watchdog@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pci@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v1 06/11] PCI: aardvark: switch to using devm_gpiod_get_optional() Message-ID: References: <20220903-gpiod_get_from_of_node-remove-v1-0-b29adfb27a6c@gmail.com> <20220903-gpiod_get_from_of_node-remove-v1-6-b29adfb27a6c@gmail.com> <20220905070046.46nlhczkck2ufr4x@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220905070046.46nlhczkck2ufr4x@pali> 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 09:00:46AM +0200, Pali Roh?r wrote: > On Sunday 04 September 2022 23:30:58 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_optional(), used devm_gpiod_get_from_of_node() is > > because it wanted to set up a pretty consumer name for the GPIO, > > IIRC consumer name is not used at all. > > The reason was to specify full name of DTS property, for easier > identification of the code. DTS property is "reset-gpios" but API > specify only "reset". I see. Do you want me to reset the patch with updated desctiption as to the reason devm_gpiod_get_from_of_node() was used? > > > and we now have a special API for that. > > > > Signed-off-by: Dmitry Torokhov > > > > diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c > > index 4834198cc86b..4a8a4a8522cb 100644 > > --- a/drivers/pci/controller/pci-aardvark.c > > +++ b/drivers/pci/controller/pci-aardvark.c > > @@ -1856,20 +1856,19 @@ static int advk_pcie_probe(struct platform_device *pdev) > > return ret; > > } > > > > - pcie->reset_gpio = devm_gpiod_get_from_of_node(dev, dev->of_node, > > - "reset-gpios", 0, > > - GPIOD_OUT_LOW, > > - "pcie1-reset"); > > + pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW); > > ret = PTR_ERR_OR_ZERO(pcie->reset_gpio); > > if (ret) { > > - if (ret == -ENOENT) { > > - pcie->reset_gpio = NULL; > > - } else { > > - if (ret != -EPROBE_DEFER) > > - dev_err(dev, "Failed to get reset-gpio: %i\n", > > - ret); > > - return ret; > > - } > > + if (ret != -EPROBE_DEFER) > > + dev_err(dev, "Failed to get reset-gpio: %i\n", > > + ret); > > + return ret; > > + } > > + > > + ret = gpiod_set_consumer_name(pcie->reset_gpio, "pcie1-reset"); > > + if (ret) { > > + dev_err(dev, "Failed to set reset gpio name: %d\n", ret); > > + return ret; > > } > > > > ret = of_pci_get_max_link_speed(dev->of_node); > > > > -- > > b4 0.10.0-dev-fc921 Thanks. -- Dmitry