mtd: spi-nor: Reorder the preparation vs. locking steps
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 28 Mar 2023 15:41:00 +0000 (17:41 +0200)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Wed, 29 Mar 2023 10:46:07 +0000 (13:46 +0300)
commit3204634772353ba965ac1f2effa948e32044efbc
treecf48e43c72ef4a5bd79e947bdd90cd767e84bf09
parentccff2cfa1ac347ee91f1b21ee99ca7ecc1d201fc
mtd: spi-nor: Reorder the preparation vs. locking steps

The ->prepare()/->unprepare() hooks are now legacy, we no longer accept
new drivers supporting them. The only remaining controllers using them
acquires a per-chip mutex, which should not interfere with the rest of
the operation done in the core. As a result, we should be safe to
reorganize these helpers to first perform the preparation, before
acquiring the core locks. This is necessary in order to be able to
improve the locking mechanism in the core (coming next). No side effects
are expected.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/r/20230328154105.448540-4-miquel.raynal@bootlin.com
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
drivers/mtd/spi-nor/core.c
drivers/mtd/spi-nor/core.h
drivers/mtd/spi-nor/otp.c
drivers/mtd/spi-nor/sst.c
drivers/mtd/spi-nor/swp.c