Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2630738pxb; Tue, 19 Jan 2021 01:59:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8yG5uXSX3mkNtgQaXZDC9U/vuHb4qOLgw5QpaF+gxUmeF5Uytxnx7RwUBmyP9+moh+DxQ X-Received: by 2002:a17:906:cedd:: with SMTP id si29mr2619379ejb.426.1611050379415; Tue, 19 Jan 2021 01:59:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611050379; cv=none; d=google.com; s=arc-20160816; b=M75xzTk2r+bqA9sQ7Dd8/ltP7ywBWxoB4ga6GseoK2+G9vgDB55g64QjRRpLTmvz2T Ff+vLtknFkTy8lwCcc1ig5U4hpVnPXuNfSSIHvd6DOjBg+FthErVq8+mGSqvVONavKje Xb0x6x1FX9w/RzlnkDwA+i0PfLrL0BGypa1suK+oUcUw4sjTflfv93cnwqKHVh90zQZN kzgLedv6Jtf4jY8BliqWneSmMJzWUMckftxF5IoMGZfXY8x8hS5o65IHhblTHZl9fuBB eE/+87PiSYgluHYihu5xBvqHVniTqdykGck958pxP7ZiYqADLzIgQRK6V3VkFJCVkwin krzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=h1qXfkO030rtL0bXTzGxpiNUZbHW6A7j25G1PiB47Rg=; b=t2sZ2ukhnM+nfSnCS2bH31vsa7P3BYAfSYFwbLLGXROGWCJgJtZPlpo06YSA6b6Yeb XQq5RVLfv/gd9Y5yYHXlBIDqpXPmXpvcm6deJ/C0vnHy/25nj/7qb2D9qq8eaIWbNPCp tIRY8LTkRG0aOsIuOoixdeje3+iPgmGuiEPaYcjIqDjrOSwkGxZNu6xBbaiDSmolEiko R0V/rr6/lIjvSzIIf5gHapEG1pdJthXEPNrhUfF455r6d3vbm61X+uDheAQ+JEJOMYXs R82KD5RZC+HwuY5TJf3cnUcqYv10OIP+EzoBV3uoICTTZtP8ooJYKPK8ipF6T+zPkSjP JFgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp19si7839282ejc.733.2021.01.19.01.59.07; Tue, 19 Jan 2021 01:59:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732929AbhASJ0A (ORCPT + 99 others); Tue, 19 Jan 2021 04:26:00 -0500 Received: from gloria.sntech.de ([185.11.138.130]:53038 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731838AbhASJMB (ORCPT ); Tue, 19 Jan 2021 04:12:01 -0500 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 Cc: Chen-Yu Tsai , Robin Murphy , Johan Jonker , linux-pci@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org 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 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 > } > } >