diff options
author | Pratyush Yadav <p.yadav@ti.com> | 2024-03-09 01:33:56 +0530 |
---|---|---|
committer | Praneeth Bajjuri <praneeth@ti.com> | 2024-03-11 13:51:58 -0500 |
commit | 9ca1870d256cd80bc78d4ea05a0f3da5d1a6db65 (patch) | |
tree | 1d3b3311a2a3e01557279a67bf20d1781b72bd75 | |
parent | b1d5329addbbdd443a0cdea23a3c2148b70df7b1 (diff) |
spi: cadence-quadspi: fix error check when finding rxhigh
During PHY calibration the return code of cqspi_find_rx_high() is not
assigned to 'ret'. So the check for failure will take the previous value
of 'ret', which will always be 0 since it was already checked by the
previous step. This means that the calibration procedure will always
think that rxhigh is found even when it is not. Fix this by assigning
the return value of cqspi_find_rx_high() to 'ret'.
Fixes: be58a6d2184f ("spi: cadence-qspi: Tune PHY to allow running at higher frequencies")
Reported-by: Brian Paiva <bpaiva@blackberry.com>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
-rw-r--r-- | drivers/spi/spi-cadence-quadspi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c index b989e39d0781..e8d91523fc1f 100644 --- a/drivers/spi/spi-cadence-quadspi.c +++ b/drivers/spi/spi-cadence-quadspi.c @@ -617,7 +617,7 @@ static int cqspi_phy_calibrate(struct cqspi_flash_pdata *f_pdata, rxhigh.tx = rxlow.tx; rxhigh.read_delay = rxlow.read_delay; - cqspi_find_rx_high(f_pdata, mem, &rxhigh); + ret = cqspi_find_rx_high(f_pdata, mem, &rxhigh); if (ret) goto out; dev_dbg(dev, "rxhigh: RX: %d TX: %d RD: %d\n", rxhigh.rx, rxhigh.tx, |