linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: "Michał Mirosław" <mirq-linux@rere.qmqm.pl>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>,
	Andrew Murray <amurray@thegoodpenguin.co.uk>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	linux-tegra@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] PCI: tegra: Fix reporting GPIO error value
Date: Wed, 15 Apr 2020 13:17:36 +0200	[thread overview]
Message-ID: <20200415111736.czeh7a3iqmmasow6@pali> (raw)
In-Reply-To: <20200414113104.GA27984@qmqm.qmqm.pl>

On Tuesday 14 April 2020 13:31:04 Michał Mirosław wrote:
> On Tue, Apr 14, 2020 at 12:25:12PM +0200, Pali Rohár wrote:
> > Error code is stored in rp->reset_gpio and not in err variable.
> > 
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> > ---
> >  drivers/pci/controller/pci-tegra.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/pci/controller/pci-tegra.c b/drivers/pci/controller/pci-tegra.c
> > index 0e03cef72840..378d5a8773c7 100644
> > --- a/drivers/pci/controller/pci-tegra.c
> > +++ b/drivers/pci/controller/pci-tegra.c
> > @@ -2314,8 +2314,8 @@ static int tegra_pcie_parse_dt(struct tegra_pcie *pcie)
> >  			if (PTR_ERR(rp->reset_gpio) == -ENOENT) {
> >  				rp->reset_gpio = NULL;
> >  			} else {
> > -				dev_err(dev, "failed to get reset GPIO: %d\n",
> > -					err);
> > +				dev_err(dev, "failed to get reset GPIO: %ld\n",
> > +					PTR_ERR(rp->reset_gpio));
> >  				return PTR_ERR(rp->reset_gpio);
> >  			}
> >  		}
> 
> You can use %pe directly on the pointer for added benefit of translation
> of the error to a name.

Well, I do not know what is the current preferred style of error
messages. On lot of places I see just numeric error numbers.

I did not wanted to change behavior of driver, I just fixed code to
report correct error value.

I do not have this hardware, so I cannot test this change. I just
spotted this problem when I was looking at other PCI controller drivers
how they issue PERST# signal to endpoint cards.

  reply	other threads:[~2020-04-15 11:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14 10:25 [PATCH] PCI: tegra: Fix reporting GPIO error value Pali Rohár
2020-04-14 11:31 ` Michał Mirosław
2020-04-15 11:17   ` Pali Rohár [this message]
2020-04-15 16:49     ` Michał Mirosław
2020-04-14 13:51 ` Thierry Reding
2020-05-07 19:44 ` Rob Herring
2020-05-11  9:47 ` Lorenzo Pieralisi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200415111736.czeh7a3iqmmasow6@pali \
    --to=pali@kernel.org \
    --cc=amurray@thegoodpenguin.co.uk \
    --cc=bhelgaas@google.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).