From: Jonathan Cameron <jic23@kernel.org>
To: phucduc.bui@gmail.com
Cc: David Lechner <dlechner@baylibre.com>,
nuno.sa@analog.com, Chen Wang <chen.wang@linux.dev>,
Inochi Amaoto <inochiama@gmail.com>,
Takashi Sakamoto <o-takashi@sakamocchi.jp>,
u.kleine-koenig@baylibre.com, Danilo Krummrich <dakr@kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>,
linux-iio@vger.kernel.org, sophgo@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iio: adc: sophgo-saradc: Handle errors from optional IRQ lookup
Date: Sat, 22 Aug 2026 02:39:59 +0100 [thread overview]
Message-ID: <20260822023959.4319f0c3@jic23-huawei> (raw)
In-Reply-To: <20260813074810.27574-1-phucduc.bui@gmail.com>
On Thu, 13 Aug 2026 14:48:10 +0700
phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> platform_get_irq_optional() returns a positive IRQ number on success or
> a negative error code on failure. For an optional IRQ, -ENXIO indicates
> that no optional IRQ is available. Other errors, such as -EPROBE_DEFER
> and -EINVAL, should be propagated so that the caller can handle them
> appropriately.
That function is very much undocumented other than not printing a
message when it returns an error. However I think you analysis is
correct.
I'm not going to rush this is because it is not known to have
been a problem in the wild (only odd loading orders should have
caused deferal).
>
> Propagate negative errors other than -ENXIO.
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
> ---
> drivers/iio/adc/sophgo-cv1800b-adc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/iio/adc/sophgo-cv1800b-adc.c b/drivers/iio/adc/sophgo-cv1800b-adc.c
> index bdc3e1326a9a..c6eed09acfcd 100644
> --- a/drivers/iio/adc/sophgo-cv1800b-adc.c
> +++ b/drivers/iio/adc/sophgo-cv1800b-adc.c
> @@ -182,6 +182,8 @@ static int cv1800b_adc_probe(struct platform_device *pdev)
> return PTR_ERR(saradc->regs);
>
> saradc->irq = platform_get_irq_optional(pdev, 0);
> + if (saradc->irq < 0 && saradc->irq != -ENXIO)
> + return saradc->irq;
> if (saradc->irq > 0) {
> init_completion(&saradc->completion);
> ret = devm_request_irq(dev, saradc->irq,
next prev parent reply other threads:[~2026-08-22 1:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-13 7:48 phucduc.bui
2026-08-22 1:39 ` Jonathan Cameron [this message]
2026-08-22 22:27 ` Bui Duc Phuc
2026-08-23 19:02 ` Jonathan Cameron
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=20260822023959.4319f0c3@jic23-huawei \
--to=jic23@kernel.org \
--cc=bhelgaas@google.com \
--cc=chen.wang@linux.dev \
--cc=dakr@kernel.org \
--cc=dlechner@baylibre.com \
--cc=inochiama@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.com \
--cc=o-takashi@sakamocchi.jp \
--cc=phucduc.bui@gmail.com \
--cc=sophgo@lists.linux.dev \
--cc=u.kleine-koenig@baylibre.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
all inboxes | Powered by JetHome®