From: Lee Jones <lee@kernel.org>
To: lee@kernel.org, Andrew Jeffery <andrew@codeconstruct.com.au>,
Avi Fishman <avifishman70@gmail.com>,
Tomer Maimon <tmaimon77@gmail.com>,
Tali Perry <tali.perry1@gmail.com>,
Patrick Venture <venture@google.com>,
Nancy Yuen <yuenn@google.com>,
Benjamin Fair <benjaminfair@google.com>,
Linus Walleij <linusw@kernel.org>,
Maulik Shah <maulik.shah@oss.qualcomm.com>,
jordan_hargrave@dell.com, tomer.maimon@nuvoton.com,
Andy Shevchenko <andy.shevchenko@gmail.com>,
openbmc@lists.ozlabs.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: [PATCH v3 08/12] pinctrl: nuvoton: npcm7xx: Fix fwnode_irq_get() error check in npcm7xx_gpio_of()
Date: Fri, 27 Nov 2026 14:04:56 +0000 [thread overview]
Message-ID: <20261127140602.2790001-9-lee@kernel.org> (raw)
In-Reply-To: <20261127140602.2790001-1-lee@kernel.org>
Commit 693c9ecd8326 ("pinctrl: nuvoton: Reduce use of OF-specific APIs")
replaced irq_of_parse_and_map(), which returns 0 on failure, with
fwnode_irq_get(), which returns a negative errno on failure (including
-EPROBE_DEFER), while leaving the !ret check unchanged. As a result,
negative error codes are stored in pctrl->gpio_bank[id].irq and passed
as large unsigned IRQ numbers when registering the GPIO chip instead of
aborting or deferring probe.
Check for ret < 0 and propagate the error code, matching the NPCM8XX
driver.
Fixes: 693c9ecd8326 ("pinctrl: nuvoton: Reduce use of OF-specific APIs")
Closes: https://sashiko.dev/#/bug/linux-95c9d7d3-32bb-4f4e-ab7f-84872957de4f
Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
---
v2 => v3:
- Rebase onto pinctrl/for-next; no functional changes.
drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
index 08eb9aca36b8..ffa2fba023af 100644
--- a/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
+++ b/drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c
@@ -1871,10 +1871,9 @@ static int npcm7xx_gpio_of(struct npcm7xx_pinctrl *pctrl)
fwnode_handle_put(args.fwnode);
ret = fwnode_irq_get(child, 0);
- if (!ret) {
- dev_err(dev, "No IRQ for GPIO bank %u\n", id);
- return -EINVAL;
- }
+ if (ret < 0)
+ return dev_err_probe(dev, ret,
+ "No IRQ for GPIO bank %u\n", id);
pctrl->gpio_bank[id].irq = ret;
pctrl->gpio_bank[id].irqbase = id * NPCM7XX_GPIO_PER_BANK;
pctrl->gpio_bank[id].pinctrl_id = args.args[0];
--
2.56.1.839.g22a8290db9-goog
next prev parent reply other threads:[~2026-11-27 14:07 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-27 14:04 [PATCH v3 00/12] pinctrl: Fix memory leaks, OOB writes, and resource handling bugs Lee Jones
2026-11-27 14:04 ` [PATCH v3 01/12] pinctrl: nuvoton: ma35: Unmap reg_base and release clock on probe error Lee Jones
2026-11-27 14:04 ` [PATCH v3 02/12] pinctrl: nuvoton: ma35: Prevent out-of-bounds write in ma35_pinctrl_get_soc_data() Lee Jones
2026-11-27 14:04 ` [PATCH v3 03/12] pinctrl: nuvoton: ma35: Retain child firmware node reference " Lee Jones
2026-11-27 14:04 ` [PATCH v3 04/12] pinctrl: nuvoton: ma35: Assign fwnode to gpio_chip in ma35_gpiolib_register() Lee Jones
2026-11-27 14:04 ` [PATCH v3 05/12] pinctrl: nuvoton: ma35: Avoid leaking map when parent node is missing Lee Jones
2026-11-27 14:04 ` [PATCH v3 06/12] pinctrl: nuvoton: Unmap GPIO bank registers on error in NPCM7xx and NPCM8xx Lee Jones
2026-11-27 14:04 ` [PATCH v3 07/12] pinctrl: nuvoton: npcm8xx: Propagate npcm8xx_gpio_register() error in probe Lee Jones
2026-11-27 14:04 ` Lee Jones [this message]
2026-11-27 14:04 ` [PATCH v3 09/12] pinctrl: single: Reject invalid register width in pcs_probe() Lee Jones
2026-11-27 14:04 ` [PATCH v3 10/12] pinctrl: single: Free pinconf settings array with pinctrl_utils_free_map() Lee Jones
2026-11-27 14:04 ` [PATCH v3 11/12] pinctrl: sunplus: Validate pin_func index in sppctl_dt_node_to_map() Lee Jones
2026-11-27 14:05 ` [PATCH v3 12/12] pinctrl: realtek: rtd1625: Set dcycle_offset to NA for pins without duty-cycle support Lee Jones
2026-11-30 21:08 ` [PATCH v3 00/12] pinctrl: Fix memory leaks, OOB writes, and resource handling bugs Linus Walleij
2026-12-01 11:03 ` Lee Jones
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=20261127140602.2790001-9-lee@kernel.org \
--to=lee@kernel.org \
--cc=andrew@codeconstruct.com.au \
--cc=andy.shevchenko@gmail.com \
--cc=avifishman70@gmail.com \
--cc=benjaminfair@google.com \
--cc=jordan_hargrave@dell.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maulik.shah@oss.qualcomm.com \
--cc=openbmc@lists.ozlabs.org \
--cc=stable@vger.kernel.org \
--cc=tali.perry1@gmail.com \
--cc=tmaimon77@gmail.com \
--cc=tomer.maimon@nuvoton.com \
--cc=venture@google.com \
--cc=yuenn@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.