diff options
| author | Takahiro Kuwano <[email protected]> | 2025-07-28 10:13:58 +0900 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2025-08-07 11:14:35 -0600 |
| commit | a0526d44daebeb39d058d8b274370c3070457727 (patch) | |
| tree | 9a378e7135fa5c6ec2c6a0f22621f53c61557dbe | |
| parent | b32dda34506b4f486bc803d0c7251f987edd2455 (diff) | |
mtd: spi-nor: Fix return value of s25_s28_mdp_ready()
s25_s28_mdp_ready() returns 1 when spansion_sr_ready() returns negative
value (error code). Fix this problem by following Linux implementation.
Fixes: 1c3dd193b5b ("mtd: spi-nor-core: Add fixups for Cypress s25hl-t/s25hs-t")
Reported-by: Hiroyuki Saito <[email protected]>
Signed-off-by: Takahiro Kuwano <[email protected]>
Reviewed-by: Tudor Ambarus <[email protected]>
| -rw-r--r-- | drivers/mtd/spi/spi-nor-core.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c index 655bf3aaf81..76c33b24368 100644 --- a/drivers/mtd/spi/spi-nor-core.c +++ b/drivers/mtd/spi/spi-nor-core.c @@ -3784,8 +3784,10 @@ static int s25_s28_mdp_ready(struct spi_nor *nor) for (addr = 0; addr < nor->mtd.size; addr += SZ_128M) { ret = spansion_sr_ready(nor, addr, nor->rdsr_dummy); - if (!ret) + if (ret < 0) return ret; + else if (ret == 0) + return 0; } return 1; |
