diff options
author | Michael Walle <michael@walle.cc> | 2022-02-23 14:43:44 +0100 |
---|---|---|
committer | Tudor Ambarus <tudor.ambarus@microchip.com> | 2022-02-25 18:11:17 +0200 |
commit | 4cf1c7bdc55c8af3a2fbc028e21918630d081f12 (patch) | |
tree | 692d3ea55765ef3bf31a8cf284906a921dff9b96 /drivers/mtd/spi-nor/core.c | |
parent | b44aa9ac6bb4a305ceb2ed224781bc10abc03b12 (diff) | |
download | linux-4cf1c7bdc55c8af3a2fbc028e21918630d081f12.tar.bz2 |
mtd: spi-nor: allow a flash to define its own ready() function
Xilinx and Micron flashes have their own implementation of the
spi_nor_ready() function. At the moment, the core will figure out
which one to call according to some flags. Lay the foundation to
make it possible that a flash can register its own ready()
function.
Signed-off-by: Michael Walle <michael@walle.cc>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Link: https://lore.kernel.org/r/20220223134358.1914798-19-michael@walle.cc
Diffstat (limited to 'drivers/mtd/spi-nor/core.c')
-rw-r--r-- | drivers/mtd/spi-nor/core.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 4d2036cdce42..390a9ab413b7 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -794,6 +794,10 @@ static int spi_nor_ready(struct spi_nor *nor) { int sr, fsr; + /* Flashes might override the standard routine. */ + if (nor->params->ready) + return nor->params->ready(nor); + if (nor->flags & SNOR_F_READY_XSR_RDY) sr = spi_nor_xsr_ready(nor); else |