From: Artem Lytkin <iprintercanon@gmail.com>
To: Marc Dietrich <marvin24@gmx.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: ac100@lists.launchpad.net, linux-tegra@vger.kernel.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Artem Lytkin <iprintercanon@gmail.com>
Subject: [PATCH] staging: nvec: propagate error codes in tegra_nvec_probe()
Date: Mon, 16 Feb 2026 20:20:11 +0000 [thread overview]
Message-ID: <20260216202011.1806-1-iprintercanon@gmail.com> (raw)
Several error paths in tegra_nvec_probe() return -ENODEV instead of
propagating the actual error code from the called function. This
prevents probe deferral from working correctly when a dependency
(clock, IRQ) is not yet available.
Fix this for platform_get_irq(), devm_clk_get(), and
devm_request_irq() by propagating their return values. Use
dev_err_probe() for the latter two to suppress log messages during
deferred probing.
The remaining -ENODEV returns for missing device tree node and
slave-addr property are left unchanged as those are permanent
configuration errors unrelated to probe deferral.
Signed-off-by: Artem Lytkin <iprintercanon@gmail.com>
---
drivers/staging/nvec/nvec.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
index 263774e6a..c4e383de5 100644
--- a/drivers/staging/nvec/nvec.c
+++ b/drivers/staging/nvec/nvec.c
@@ -809,13 +809,12 @@ static int tegra_nvec_probe(struct platform_device *pdev)
nvec->irq = platform_get_irq(pdev, 0);
if (nvec->irq < 0)
- return -ENODEV;
+ return nvec->irq;
i2c_clk = devm_clk_get(dev, "div-clk");
- if (IS_ERR(i2c_clk)) {
- dev_err(dev, "failed to get controller clock\n");
- return -ENODEV;
- }
+ if (IS_ERR(i2c_clk))
+ return dev_err_probe(dev, PTR_ERR(i2c_clk),
+ "failed to get controller clock\n");
nvec->rst = devm_reset_control_get_exclusive(dev, "i2c");
if (IS_ERR(nvec->rst)) {
@@ -847,10 +846,8 @@ static int tegra_nvec_probe(struct platform_device *pdev)
err = devm_request_irq(dev, nvec->irq, nvec_interrupt, IRQF_NO_AUTOEN,
"nvec", nvec);
- if (err) {
- dev_err(dev, "couldn't request irq\n");
- return -ENODEV;
- }
+ if (err)
+ return dev_err_probe(dev, err, "couldn't request irq\n");
tegra_init_i2c_slave(nvec);
--
2.43.0
reply other threads:[~2026-02-16 20:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260216202011.1806-1-iprintercanon@gmail.com \
--to=iprintercanon@gmail.com \
--cc=ac100@lists.launchpad.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-tegra@vger.kernel.org \
--cc=marvin24@gmx.de \
/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