From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E2E8AECAAD5 for ; Mon, 5 Sep 2022 07:37:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KqqGQh14e+fcUxOywlxINdhVy+omDyCXwcIg6xfB5io=; b=lw0DJX3PUjtIHt tTHV4RQMOWobMKL+lLvwA8YriMMUZsl5UVqE1qNbv0Sbp/CRM7UAmc7BJlO/9eeSGCk/s209pE8RL LKSGbJK7iK+2PhdwWCWsUPE9A+Uc5LA93zS1sNjqNt6MLh3S8gkh7yFlS3+2nN+nPIuasM5vwoLrz xNAsPRyBMxzsw3PIKuETik3ua/h+f+hQo79BlyG/M3Jsn8BJRV0Royp8tdm+OsOM/NVWnHuGG19Hd 7A3ZnUwmWAWF1VVwehaRA/3ccfBlT9FAB+5m/G/aOorocQ4EjuvcAd0CO9v+Rv8OadYGu9qz0fQdB KZMzozTAN1siTYQKCooA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV6dm-00DPlD-RO; Mon, 05 Sep 2022 07:35:33 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oV66F-00Cnbg-OW; Mon, 05 Sep 2022 07:00:55 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4C5AE610D5; Mon, 5 Sep 2022 07:00:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D7C2C4347C; Mon, 5 Sep 2022 07:00:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662361249; bh=sMqNChAqUECLA/JxRoCLreDX4YMFCPUAc1lHPAydczs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jQjAxvsHcmQag5VnQ24RHPh71SfFAnZs3r5os/qxcy2nP7pTiLrT8aZ2UJaioDTdX sGsVDpUjt9mNTJD1dW9aYcOALEb/jjWD0tvFriCDkrKnWVUJvIP7WqJglzJaMnRFS2 TsdugTYds2kNcKwWnNS0pI0CnwAdOf4NHbUt1cf9oalUU8EmzRVxw8LgZyN8zlLoem ft9mOcKkFeipIujNN+nhxULQAa2YtPZlRdezV5Bx2YBixBzIBh+MMmwMIhxO5cJxzy zFG1mfj+u+Lub4ECQeFYAZGmVT7vE84nZY9fgIUnFx9Hoecvlb8u37uBG8v3SPolrE 4VCPdOFkB7Pcg== Received: by pali.im (Postfix) id 3D0927D7; Mon, 5 Sep 2022 09:00:46 +0200 (CEST) Date: Mon, 5 Sep 2022 09:00:46 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Dmitry Torokhov Subject: Re: [PATCH v1 06/11] PCI: aardvark: switch to using devm_gpiod_get_optional() Message-ID: <20220905070046.46nlhczkck2ufr4x@pali> 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-6-b29adfb27a6c@gmail.com> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_000052_045862_6EDAE74B X-CRM114-Status: GOOD ( 26.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Alexandre Belloni , Vignesh Raghavendra , David Airlie , linux-pci@vger.kernel.org, Linus Walleij , Alexandre Torgue , dri-devel@lists.freedesktop.org, Liam Girdwood , linux-tegra@vger.kernel.org, Thierry Reding , linux-mtd@lists.infradead.org, Thomas Petazzoni , Miquel Raynal , linux-stm32@st-md-mailman.stormreply.com, Alyssa Rosenzweig , linux-watchdog@vger.kernel.org, Rob Herring , Marc Zyngier , Bartosz Golaszewski , Jonathan Hunter , Lorenzo Pieralisi , Guenter Roeck , Maxime Coquelin , Matti Vaittinen , linux-gpio@vger.kernel.org, Mark Brown , Bjorn Helgaas , Wim Van Sebroeck , linux-arm-kernel@lists.infradead.org, Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Vetter , Richard Weinberger , Claudiu Beznea Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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". > 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel