Merge patch series "spi: cadence_qspi: Fix Smatch reported issues"
Andrew Goodbody <andrew.goodbody@linaro.org> says: Smatch reported issues with an off by 1 error in a test for a timeout and also an error exit that did not set an error code. Link: https://lore.kernel.org/r/20250812-cadence_qspi-v1-0-0d693d810145@linaro.org
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -354,7 +354,7 @@ void cadence_qspi_apb_controller_init(struct cadence_spi_priv *priv)
|
||||
|
||||
int cadence_qspi_apb_exec_flash_cmd(void *reg_base, unsigned int reg)
|
||||
{
|
||||
unsigned int retry = CQSPI_REG_RETRY;
|
||||
int retry = CQSPI_REG_RETRY;
|
||||
|
||||
/* Write the CMDCTRL without start execution. */
|
||||
writel(reg, reg_base + CQSPI_REG_CMDCTRL);
|
||||
@@ -369,7 +369,7 @@ int cadence_qspi_apb_exec_flash_cmd(void *reg_base, unsigned int reg)
|
||||
udelay(1);
|
||||
}
|
||||
|
||||
if (!retry) {
|
||||
if (retry == -1) {
|
||||
printf("QSPI: flash command execution timeout\n");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user