From: sashiko-bot@kernel.org
To: "Haotian Zhang" <vulab@iscas.ac.cn>
Cc: linux-gpio@vger.kernel.org
Subject: Re: [PATCH] gpio: pxa: propagate pxa_gpio_probe_dt() error code
Date: Fri, 09 Oct 2026 05:16:18 +0000 [thread overview]
Message-ID: <sashiko-outbox-164878@kernel.org> (raw)
In-Reply-To: <20261009050604.3128124-1-vulab@iscas.ac.cn>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] gpio: pxa: probe returns -EPERM (-1) when CONFIG_OF is disabled
--
commit e354788ab87bb0e86721190d9d799a35572742ca
Author: Haotian Zhang <vulab@iscas.ac.cn>
gpio: pxa: propagate pxa_gpio_probe_dt() error code
pxa_gpio_probe_dt() returns the negative errno produced by
devm_irq_alloc_descs(), which may be -ENOMEM, -EINVAL or -EEXIST. The
caller in pxa_gpio_probe() overwrites that value with a fixed -EINVAL, so
the actual reason for the failure is lost. Return irq_base so that the
original error code is propagated.
> diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c
> index 3ff21e8992788..7d513932d09f0 100644
> --- a/drivers/gpio/gpio-pxa.c
> +++ b/drivers/gpio/gpio-pxa.c
> @@ -632,7 +632,7 @@ static int pxa_gpio_probe(struct platform_device *pdev)
> } else {
> irq_base = pxa_gpio_probe_dt(pdev, pchip);
> if (irq_base < 0)
> - return -EINVAL;
> + return irq_base;
[Severity: Low]
Does this unintentionally return -EPERM when CONFIG_OF is disabled?
When CONFIG_OF is not enabled, pxa_gpio_probe_dt() is defined as a stub that
returns -1:
#else
#define pxa_gpio_probe_dt(pdev, pchip) (-1)
#endif
With this patch, pxa_gpio_probe() will now directly propagate that -1, which
translates to -EPERM. This seems like a misleading error code for missing
platform data or device tree configuration compared to the previous -EINVAL.
> }
>
> if (!pxa_last_gpio)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261009050604.3128124-1-vulab@iscas.ac.cn?part=1
next prev parent reply other threads:[~2026-10-09 5:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-09 5:06 [PATCH] gpio: pxa: propagate pxa_gpio_probe_dt() error code Haotian Zhang
2026-10-09 5:16 ` sashiko-bot [this message]
2026-10-09 6:07 ` Krzysztof Kozlowski
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=sashiko-outbox-164878@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=vulab@iscas.ac.cn \
/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