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 X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AA50C433DB for ; Tue, 19 Jan 2021 09:12:41 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3BA723159 for ; Tue, 19 Jan 2021 09:12:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3BA723159 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=mubAr2yhLfYazu5vPtUOIkxG6j6cqov3SfeA+8Ir9ys=; b=XJcFrNsTbrkB8jM+qbjbThL6C 76qiAIqQbqncKfLr71ioJilpShEAKNn6y4oSbG6yX/tv066kvg+gSVvm4N+h8UhPkyDX/dPx/hoBG h54Ucnw1uL5S1N5Xusz5K9I7P4/MO4K6mOo0SdQkvnTB1HeBy3KLdA3h6mIGhELn7j56yduQmPXH3 N6wETbN6dxogJadKLf8tzpLcGLdh5QHWcn9gZ+dV168Hm/bx8VfpPuUuZvihchdhYFO8uSRJHC5e3 5j84WD3Q+wFD6kpiT2M0y1DsqtGyVtHcFmyCp4Ed9gNNmPV2rR18RWDVinc2hv9rlZUqCdq/wXH53 a76f1GFLw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1n2n-0006Ug-K2; Tue, 19 Jan 2021 09:11:21 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1n2k-0006U6-QB; Tue, 19 Jan 2021 09:11:19 +0000 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1n2U-0004qx-Qk; Tue, 19 Jan 2021 10:11:02 +0100 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Shawn Lin , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Chen-Yu Tsai Subject: Re: [PATCH v3 1/4] PCI: rockchip: Make 'ep-gpios' DT property optional Date: Tue, 19 Jan 2021 10:11:01 +0100 Message-ID: <12687142.y0N7aAr316@diego> In-Reply-To: <20210106134617.391-2-wens@kernel.org> References: <20210106134617.391-1-wens@kernel.org> <20210106134617.391-2-wens@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210119_041118_863300_E26BB3A1 X-CRM114-Status: GOOD ( 21.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Chen-Yu Tsai , Johan Jonker , Robin Murphy , linux-arm-kernel@lists.infradead.org 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 Am Mittwoch, 6. Januar 2021, 14:46:14 CET schrieb Chen-Yu Tsai: > From: Chen-Yu Tsai > > The Rockchip PCIe controller DT binding clearly states that 'ep-gpios' is > an optional property. And indeed there are boards that don't require it. > > Make the driver follow the binding by using devm_gpiod_get_optional() > instead of devm_gpiod_get(). > > Fixes: e77f847df54c ("PCI: rockchip: Add Rockchip PCIe controller support") > Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC driver") > Fixes: 964bac9455be ("PCI: rockchip: Split out rockchip_pcie_parse_dt() to parse DT") > Signed-off-by: Chen-Yu Tsai > --- > Heiko, I dropped you reviewed-by due to the error message change > > Changes since v2: > - Fix error message for failed GPIO > > Changes since v1: > - Rewrite subject to match existing convention and reference > 'ep-gpios' DT property instead of the 'ep_gpio' field > --- > drivers/pci/controller/pcie-rockchip.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c > index 904dec0d3a88..90c957e3bc73 100644 > --- a/drivers/pci/controller/pcie-rockchip.c > +++ b/drivers/pci/controller/pcie-rockchip.c > @@ -118,9 +118,10 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip) > } > > if (rockchip->is_rc) { > - rockchip->ep_gpio = devm_gpiod_get(dev, "ep", GPIOD_OUT_HIGH); > + rockchip->ep_gpio = devm_gpiod_get_optional(dev, "ep", GPIOD_OUT_HIGH); > if (IS_ERR(rockchip->ep_gpio)) { > - dev_err(dev, "missing ep-gpios property in node\n"); > + dev_err_probe(dev, PTR_ERR(rockchip->ep_gpio), > + "failed to get ep GPIO\n"); > return PTR_ERR(rockchip->ep_gpio); looking at [0] shouldn't that be just return dev_err_probe(dev, PTR_ERR(.....)...); instead of dev_err_probe + additional return? Heiko [0] https://elixir.bootlin.com/linux/latest/source/drivers/base/core.c#L4223 > } > } > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel