Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3573892pxb; Mon, 16 Nov 2020 19:47:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwmGvx6H2PxuLPVq0OEH9+uxXPD2Z7HqLjVAzk9LC4nkHWkju4OvZ2y7iI20tpzR/EIaiiy X-Received: by 2002:aa7:d5d7:: with SMTP id d23mr19101210eds.203.1605584861924; Mon, 16 Nov 2020 19:47:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605584861; cv=none; d=google.com; s=arc-20160816; b=dgRDZBUUQKBML+RtDVjcnpzHR1QsRBgWUvXDjttbiafRadUE8Sd3lJBg+5OIXH+nTt 42CG6PS2juACwu97jX/XhHz7qBC33ujX0wbGcJjh1DIqnN/Oim/Okq4Ojs+u2qov1OIa ncjRhjokSvXfn8ANp9xxywo9zIHL0YwkMb/eqaB3KbpEdEIrjWk5xnrf5qpv1LSQV9MC YbnKcT/b8qTY595Msp3yky1lD9RLyONVqCySZrpxisOG7+5ACtFVYXxqMrgUJegD0M4b s+pvvUk9zR0dtS8GhstdmzUUiuO+5xcUlDhqi2wXGItHjdaz1YvtCyw9vncCmPr+UY9Z 6Uew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=r3+TJVedZK11hBjwrdJtPvpXraNKg5Yol5JN82rFE38=; b=ZswabLqcZFXXOmcOt0zEYyZgLcgzU46uvl/QZ2sR5sZabSc3DnlrN0U3z4YkRdAZEr e6fw2UvwVht7M3ZCcecZYSa3/A9QTeR3gfMie8LOgWxoq/Q77M+4MRe0hlzCvniy7SWr 5PGX5t8Fxr42k2psqi6LJa7Vx9S3g2iYen7dez3LAb+kmorgkujdCMXPDIMpg1GjKpsz syGmR1XOUjM66egELGFySVu3Mq9sdcrFd40fXX6enFWbBISFnDzEL26ylpO/xRf72FYf B3bM43VIU8i13EbOOHwEmBD8pFByn/1d78hdsKeD1Df2PZQxEGeyCzN2n6nGhDfIKw0e K6UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VjjlEIGg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p62si12377801edd.213.2020.11.16.19.47.19; Mon, 16 Nov 2020 19:47:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=VjjlEIGg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbgKQDpZ (ORCPT + 99 others); Mon, 16 Nov 2020 22:45:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:38864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726437AbgKQDpW (ORCPT ); Mon, 16 Nov 2020 22:45:22 -0500 Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E12A6206C0; Tue, 17 Nov 2020 03:45:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605584722; bh=drQcFzeE83tYePhTQAMPI109uNcJDc7j2Dq1wNZibSE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=VjjlEIGgDNDhib3HCD/ecC6ccR7GzEYF9OdOftw9gAYWzFub+Viwl4q+IUWmwlF2Y urB1uwAis2lyOonRS8IIOXWG7VEZDmC46HVF66jLRVxYfRJMqqivSXdPv+26HnOiVm AKMffiOwCL+v1YuqZgKBoeN/92pD/1KELFik5mvQ= Received: by mail-lf1-f52.google.com with SMTP id s30so28221660lfc.4; Mon, 16 Nov 2020 19:45:21 -0800 (PST) X-Gm-Message-State: AOAM530SyYEIoB+lYsTP9NNUUYLxyv5fyX3QTWdfJV25e/7yZwrYQFIF f0gLJDqRzzJBvk5DXbKUm9xsUAgVJbvVcDfb+p8= X-Received: by 2002:a19:c354:: with SMTP id t81mr860303lff.283.1605584720130; Mon, 16 Nov 2020 19:45:20 -0800 (PST) MIME-Version: 1.0 References: <20201116075215.15303-2-wens@kernel.org> <20201116164159.GA1282970@bjorn-Precision-5520> In-Reply-To: <20201116164159.GA1282970@bjorn-Precision-5520> From: Chen-Yu Tsai Date: Tue, 17 Nov 2020 11:45:09 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/4] PCI: rockchip: make ep_gpio optional To: Bjorn Helgaas Cc: Chen-Yu Tsai , Shawn Lin , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Heiko Stuebner , Robin Murphy , Johan Jonker , linux-pci@vger.kernel.org, "open list:ARM/Rockchip SoC..." , linux-arm-kernel , linux-kernel , devicetree Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 17, 2020 at 12:42 AM Bjorn Helgaas wrote: > > Run "git log --oneline drivers/pci/controller/pcie-rockchip.c" (or > even just look at the Fixes: commits you mention) and follow the > convention, e.g., > > PCI: rockchip: Make 'ep-gpios' DT property optional > > Also, you used 'ep_gpio' (singular, with an underline) in the subject > but 'ep-gpios' (plural, with hyphen) in the commit log. The error > message and Documentation/devicetree/bindings/pci/rockchip-pcie-host.txt > both say 'ep-gpios' (plural, with hyphen). 'ep_gpio' refers to the variable used within the driver. But reading it again, it does seem kind of weird. I will rewrite it to be more consistent. ChenYu > Please fix so this is all consistent. Details matter. > > On Mon, Nov 16, 2020 at 03:52:12PM +0800, Chen-Yu Tsai wrote: > > 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 > > --- > > drivers/pci/controller/pcie-rockchip.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c > > index 904dec0d3a88..c95950e9004f 100644 > > --- a/drivers/pci/controller/pcie-rockchip.c > > +++ b/drivers/pci/controller/pcie-rockchip.c > > @@ -118,7 +118,7 @@ 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"); > > return PTR_ERR(rockchip->ep_gpio); > > -- > > 2.29.1 > >