]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
staging: nvec: propagate error codes in tegra_nvec_probe()
authorArtem Lytkin <iprintercanon@gmail.com>
Mon, 16 Feb 2026 20:20:11 +0000 (20:20 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Feb 2026 14:44:44 +0000 (15:44 +0100)
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>
Link: https://patch.msgid.link/20260216202011.1806-1-iprintercanon@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/nvec/nvec.c

index e9af66a0844834b499e4c0e4cd5f90558d040e78..c6be750bee9df139179f2f6e3da707d6e5ab71d1 100644 (file)
@@ -811,13 +811,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)) {
@@ -849,10 +848,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);