From: Mark Brown <broonie@kernel.org>
To: Conor.Dooley@microchip.com
Cc: Daire.McNamara@microchip.com, Lewis.Hanly@microchip.com,
linux-riscv@lists.infradead.org, linux-spi@vger.kernel.org,
linux-kernel@vger.kernel.org, dan.carpenter@oracle.com
Subject: Re: [PATCH] spi: microchip-core: fix passing zero to PTR_ERR warning
Date: Wed, 15 Jun 2022 13:37:40 +0100 [thread overview]
Message-ID: <YqnSlIcAadwxt1Q5@sirena.org.uk> (raw)
In-Reply-To: <7eda95bd-c7f5-767a-fe88-9f7109467cd8@microchip.com>
[-- Attachment #1: Type: text/plain, Size: 885 bytes --]
On Wed, Jun 15, 2022 at 11:57:37AM +0000, Conor.Dooley@microchip.com wrote:
> On 15/06/2022 12:40, Mark Brown wrote:
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> > On Wed, Jun 15, 2022 at 12:30:22PM +0100, Conor Dooley wrote:
> >> - ret = PTR_ERR(spi->clk);
> >> + ret = !spi->clk ? -ENXIO : PTR_ERR(spi->clk);
> > I think you're looking for PTR_ERR_OR_ZERO() here?
> Maybe I don't understand, so let me explain what I think you're
> suggesting & maybe you can correct me:
> > - ret = PTR_ERR(spi->clk);
> > + ret = PTR_ERR_OR_ZERO(spi->clk);
> But if spi->clk is NULL, this will return 0 from the probe
> rather than returning an error?
> If that's not what you meant, lmk
Oh, hang on - what error conditions can clk_get() return 0 in? The
documentation doesn't mention any...
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2022-06-15 12:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-15 11:30 Conor Dooley
2022-06-15 11:40 ` Mark Brown
2022-06-15 11:57 ` Conor.Dooley
2022-06-15 12:37 ` Mark Brown [this message]
2022-06-15 12:42 ` Conor.Dooley
2022-06-15 12:49 ` Mark Brown
2022-06-15 12:51 ` Conor.Dooley
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=YqnSlIcAadwxt1Q5@sirena.org.uk \
--to=broonie@kernel.org \
--cc=Conor.Dooley@microchip.com \
--cc=Daire.McNamara@microchip.com \
--cc=Lewis.Hanly@microchip.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-spi@vger.kernel.org \
/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
all inboxes | Powered by JetHome®