summaryrefslogtreecommitdiff
path: root/drivers/mtd/spi-nor/swp.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-03-28 18:41:00 +0300
committerTudor Ambarus <tudor.ambarus@linaro.org>2023-03-29 13:46:07 +0300
commit3204634772353ba965ac1f2effa948e32044efbc (patch)
treecf48e43c72ef4a5bd79e947bdd90cd767e84bf09 /drivers/mtd/spi-nor/swp.c
parentccff2cfa1ac347ee91f1b21ee99ca7ecc1d201fc (diff)
downloadlinux-3204634772353ba965ac1f2effa948e32044efbc.tar.xz
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>
Diffstat (limited to 'drivers/mtd/spi-nor/swp.c')
-rw-r--r--drivers/mtd/spi-nor/swp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mtd/spi-nor/swp.c b/drivers/mtd/spi-nor/swp.c
index 1f178313ba8f..0ba716e84377 100644
--- a/drivers/mtd/spi-nor/swp.c
+++ b/drivers/mtd/spi-nor/swp.c
@@ -348,7 +348,7 @@ static int spi_nor_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
struct spi_nor *nor = mtd_to_spi_nor(mtd);
int ret;
- ret = spi_nor_lock_and_prep(nor);
+ ret = spi_nor_prep_and_lock(nor);
if (ret)
return ret;
@@ -363,7 +363,7 @@ static int spi_nor_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len)
struct spi_nor *nor = mtd_to_spi_nor(mtd);
int ret;
- ret = spi_nor_lock_and_prep(nor);
+ ret = spi_nor_prep_and_lock(nor);
if (ret)
return ret;
@@ -378,7 +378,7 @@ static int spi_nor_is_locked(struct mtd_info *mtd, loff_t ofs, uint64_t len)
struct spi_nor *nor = mtd_to_spi_nor(mtd);
int ret;
- ret = spi_nor_lock_and_prep(nor);
+ ret = spi_nor_prep_and_lock(nor);
if (ret)
return ret;