From: phucduc.bui@gmail.com
To: Linus Walleij <linusw@kernel.org>
Cc: Darian Biastoch <d.biastoch@gmail.com>,
Andreas Kaessens <akaessens@gmail.com>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH v2] pinctrl: mcp23s08: Propagate reset GPIO errors
Date: Mon, 12 Oct 2026 08:54:33 +0700 [thread overview]
Message-ID: <20261012015433.6155-1-phucduc.bui@gmail.com> (raw)
From: bui duc phuc <phucduc.bui@gmail.com>
devm_gpiod_get_optional() may return -EPROBE_DEFER or other errors,
but mcp23s08_probe_one() currently ignores them.
Check the return value and propagate errors from the reset GPIO lookup.
Fixes: 4e73bfa3ee37 ("pinctrl: mcp23s08: Add optional reset GPIO")
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
-return ERR_PTR(-EPROBE_DEFER) instead of uninitialized ret variable
drivers/pinctrl/pinctrl-mcp23s08.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pinctrl/pinctrl-mcp23s08.c b/drivers/pinctrl/pinctrl-mcp23s08.c
index cc668f84bf8b..259ac02134c6 100644
--- a/drivers/pinctrl/pinctrl-mcp23s08.c
+++ b/drivers/pinctrl/pinctrl-mcp23s08.c
@@ -613,6 +613,9 @@ int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
mcp->chip.owner = THIS_MODULE;
mcp->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(mcp->reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(mcp->reset_gpio),
+ "failed to get reset GPIO\n");
/* verify MCP_IOCON.SEQOP = 0, so sequential reads work,
* and MCP_IOCON.HAEN = 1, so we work with all chips.
--
2.43.0
next reply other threads:[~2026-10-12 1:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-12 1:54 phucduc.bui [this message]
2026-10-12 2:01 ` [PATCH v2] pinctrl: mcp23s08: Propagate reset GPIO errors sashiko-bot
2026-10-12 5:53 ` Bui Duc Phuc
2026-10-12 8:04 ` Linus Walleij
2026-10-12 8:28 ` Bui Duc Phuc
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=20261012015433.6155-1-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=akaessens@gmail.com \
--cc=d.biastoch@gmail.com \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@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 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.