]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spi: cadence_qspi: Do not return unset error code
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Tue, 12 Aug 2025 11:34:39 +0000 (12:34 +0100)
committerTom Rini <trini@konsulko.com>
Tue, 28 Oct 2025 16:27:40 +0000 (10:27 -0600)
In spi_calibration if the low range fails to calibrate then the code
attempted to return the variable err but this has not been set in this
case. Instead just return -EIO.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/spi/cadence_qspi.c

index 9edbfaa821b64a542636433fe1054afce5de8cb2..d8d9a4056fe46ae095d6e093cbe3e5bb4d8f6736 100644 (file)
@@ -142,7 +142,7 @@ static int spi_calibration(struct udevice *bus, uint hz)
 
        if (range_lo == -1) {
                puts("SF: Calibration failed (low range)\n");
-               return err;
+               return -EIO;
        }
 
        /* Disable QSPI for subsequent initialization */