Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2738283rwb; Mon, 5 Sep 2022 00:03:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR65cowSzIGzNs2TseNctklQhxJmVv7k2coEVhPFEGitxOZHLmmAhGTWCj8+RZPVttQYAIYI X-Received: by 2002:a05:6402:551a:b0:446:1526:85ea with SMTP id fi26-20020a056402551a00b00446152685eamr42706652edb.188.1662361436855; Mon, 05 Sep 2022 00:03:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662361436; cv=none; d=google.com; s=arc-20160816; b=zmB1dfeYjkbSXsDR40CLb1n+W4NQ9XMUqnyApMEnlfT7seLLY1pFzN6LqARFbpgkj+ np9PhFHke8kxkpTr2aorFXoru4zs5e7pVPg9ads6udjAH0QYNCKckaaxE3lbJdGgYf9v TnZ1UVJWWZFR+Z0j73ZFxoM/zLvMXB0GJKP1SrGY64/jpvEFVGD/prr0k5FBQcxFWXeq ryeL9+lcjsYLGZ+k6tOj7kCTcivxtXaTJ7Steh3DYobrg9kk/T9JlCWP3qTCfkHpbEQ9 2+qqHv/bv3x1zgckF3l2qOzI1q6ts5zyZ3yMsF/jZSlqz/XcuZgJ5tE39oLC3T4TaItw WhKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=5PnSIf0nQYKcGy/5sVsUHzVQVvI3ADIYONXFnDbKILc=; b=0IJn48CSX/Rnljdn2zOxgpG5EcYHU9K8r9WvboZW3WKo4W1gvWOqPZG3ZnLIq4yzlo Xa2j0SJn3wHigUi2s+U5hmZGA5QBah1y5QQAvWQqB+mL/kBWwAdJYaZaBUD4+Jkjourd utBZKbiJlI1uK1ZMdELWgGvbg9ClwLknpFRfV1ViYQugWeKxi4Ap+Ov6Yyjr+TJpJRZL p1NnHW++rAWGEb8gEOLo0NKqexdCKoRTljH0i/c6n7hIGdUAo2WRlWU/HA/l5mEju6vh lUY+gs0LYujCnPOG52qVM+fw+kSZYVXopgq9qWLhatOV/pADnN6c+4ixj1VlLVXnFJ+E Bx2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jQjAxvsH; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cr21-20020a170906d55500b0073d7121c675si6147529ejc.408.2022.09.05.00.03.28; Mon, 05 Sep 2022 00:03:56 -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=@kernel.org header.s=k20201202 header.b=jQjAxvsH; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236493AbiIEHBD (ORCPT + 99 others); Mon, 5 Sep 2022 03:01:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236269AbiIEHA5 (ORCPT ); Mon, 5 Sep 2022 03:00:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B312F22B14; Mon, 5 Sep 2022 00:00:52 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 39122B80ED2; Mon, 5 Sep 2022 07:00:51 +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 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: <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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220903-gpiod_get_from_of_node-remove-v1-6-b29adfb27a6c@gmail.com> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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