Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2630734pxb; Tue, 19 Jan 2021 01:59:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJw2eG4NhKoUd8ljqnZjjQ1RjHgWnyGM5ylL7bU9TWrBr2DQUyx7UNnisaoSomcfbU1n9lEv X-Received: by 2002:aa7:c3cf:: with SMTP id l15mr2849051edr.282.1611050379311; 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=Nk+mpSvNcCve0srCnZf+lARFQn56I6nOC3uknHfMHMnLrHAi3/OB8qXSG0fgeAp31P ah6jf5qNSQCENNRZnfUc1+wTKLrGwrJDN7gdBi8KUQun3dCyiocmf/3i4hr7XROIfwS1 mQTuIm/nV17cq3rt69TR2gM/8gCDNSB+6KNIhEuYUfmjwc8cD/wz80GgGJKw0jnjfOUe Dlu2g66/E6vvWAqAZZoprq/uhttqow/SuKUAySf/nDbOq8gfgpnvMXrTVa2Ejs0Oy1ga 6NQgQUVMZxc8dN/I2bDm/6ugzsg9ThJEKYUz6Gp0WhnC6i90I8E5rUxmggamnaVYOlX1 Ay8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0kZZXp/qCVe+GSOPjLnV+3jfOpGYFuVJVnWNyeAKFN8=; b=XzALEtfULa5d1ahVzDxs44SJ+T6IBeIV7wer6x1ABQ4XisEnYqebg9IOXUfvWyaGgr P4fwwiADJMtZMlEXLNAw/UwfzH0eXdH07AunTHvcxIk65iAPv91fhbaEnhFUhQR6Jzqf VehLlMA8iMX7fzwqHXEe6thVmcDWQJwbYgbFnp4Hltoj1D4VOjV8lC/N/jjcKlLBphtt KTT2xjLEFIU+KtKsckP3Sv+zOrhbhZlozTo2q4xKW5Rh1lMHAsZfN1AzBot7BWMImimq bsz/06DORrSJgAaLVe1HXS16HQMERNsEahaIUMRdFjK3/71YckxJMRg5B4wZf9kV8Qkp +Rdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Aq0084h9; 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 di1si2601075edb.76.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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Aq0084h9; 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 S1733226AbhASJ1W (ORCPT + 99 others); Tue, 19 Jan 2021 04:27:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:57512 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732149AbhASJQm (ORCPT ); Tue, 19 Jan 2021 04:16:42 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF18623139; Tue, 19 Jan 2021 09:15:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611047759; bh=b4Cf+wcAxaeMO0xd+RigZ7MJ8HZVYfOhWxJaBWs7WvM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Aq0084h9/Uccjg5CXUGB4RCgPArQsWrOYebgPiDSxJHpWp1+mU+8aWXHfHThHEQ8f A7ms7bqN+3jJWIthcfpeYhHCagIBHEsK/Pau6kwWubLLAIWAY0mDpN2hi2wqHSszBr IqIQYoBCyF4DuFlP/seAev0fagLUsTUzqTYUwpUsQ3IkJSn8O+HR399TWKcO9UGd8q Fugvl/mK6d6ZM6qvwDbeSGjAMc+wU797GbSBQ6OQ5fvsWct//qBsL6JAt+2LLD7w9X OCDM+c+twgMHOknYTi3Y27h5D+VxkCqu4pWsXOS1Imy/FVFOUaP1ZocgpOVaX7T/Ye IfLGZMXxlZWuw== Received: by mail-lj1-f169.google.com with SMTP id f11so21079364ljm.8; Tue, 19 Jan 2021 01:15:58 -0800 (PST) X-Gm-Message-State: AOAM531cPqsYLDJ4eZeR8ArWGAhnUDyq0xFhfZj/ftW18Zgbw5Bq94/n tQWbP/msEES2kPKwCX2lSW1rxqxOGG5lvMVx9ww= X-Received: by 2002:a2e:8852:: with SMTP id z18mr1618577ljj.94.1611047757110; Tue, 19 Jan 2021 01:15:57 -0800 (PST) MIME-Version: 1.0 References: <20210106134617.391-1-wens@kernel.org> <20210106134617.391-2-wens@kernel.org> <12687142.y0N7aAr316@diego> In-Reply-To: <12687142.y0N7aAr316@diego> From: Chen-Yu Tsai Date: Tue, 19 Jan 2021 17:15:45 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 1/4] PCI: rockchip: Make 'ep-gpios' DT property optional To: =?UTF-8?Q?Heiko_St=C3=BCbner?= Cc: Shawn Lin , Lorenzo Pieralisi , Rob Herring , Bjorn Helgaas , Chen-Yu Tsai , Robin Murphy , Johan Jonker , PCI , "open list:ARM/Rockchip SoC..." , linux-arm-kernel , linux-kernel , devicetree Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 19, 2021 at 5:11 PM Heiko St=C3=BCbner wrote: > > 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 suppo= rt") > > Fixes: 956cd99b35a8 ("PCI: rockchip: Separate common code from RC drive= r") > > 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/contr= oller/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 *r= ockchip) > > } > > > > if (rockchip->is_rc) { > > - rockchip->ep_gpio =3D devm_gpiod_get(dev, "ep", GPIOD_OUT= _HIGH); > > + rockchip->ep_gpio =3D 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? You're right. I was only expecting dev_err_probe() to deal with -EPROBE_DEF= ER. I believe there won't be any future changes that would add any code here, so I'll respin with the proper changes you mentioned. Thanks! ChenYu > Heiko > > [0] https://elixir.bootlin.com/linux/latest/source/drivers/base/core.c#L4= 223 > > > } > > } > > > > > >