aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlgapally Santosh Sagar <santoshsagar.algapally@amd.com>2022-11-21 22:18:33 -0700
committerMichal Simek <michal.simek@amd.com>2022-12-05 10:01:45 +0100
commit7ad3c09e7911e71c9a16a30aa052093a8f9b7e7c (patch)
tree377bbe1f2260b1caa7d6b630391d0154b3c9ebd5
parentb40d154ced47d43005f683f7e089b9c016c8ea3d (diff)
downloadu-boot-7ad3c09e7911e71c9a16a30aa052093a8f9b7e7c.zip
u-boot-7ad3c09e7911e71c9a16a30aa052093a8f9b7e7c.tar.gz
u-boot-7ad3c09e7911e71c9a16a30aa052093a8f9b7e7c.tar.bz2
mtd: spi-nor-core: Invert logic to reflect sst26 flash unlocked
flash_is_locked is changed to flash_is_unlocked with commit 513c6071ce73 ("mtd: spi: Convert is_locked callback to is_unlocked"). sst26_is_locked() is also changed to sst26_is_unlocked() but the logic remained same. Invert the logic for the flash lock/unlock to work properly. Signed-off-by: Algapally Santosh Sagar <santoshsagar.algapally@amd.com> Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@amd.com> Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com> Reviewed-by: Dhruva Gole <d-gole@ti.com> Link: https://lore.kernel.org/r/20221122051833.13306-1-ashok.reddy.soma@amd.com Signed-off-by: Michal Simek <michal.simek@amd.com>
-rw-r--r--drivers/mtd/spi/spi-nor-core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/spi/spi-nor-core.c b/drivers/mtd/spi/spi-nor-core.c
index 78de3c5..1ea8363 100644
--- a/drivers/mtd/spi/spi-nor-core.c
+++ b/drivers/mtd/spi/spi-nor-core.c
@@ -1600,7 +1600,7 @@ static int sst26_is_unlocked(struct spi_nor *nor, loff_t ofs, uint64_t len)
ofs -= ofs & (SZ_64K - 1);
len = len & (SZ_64K - 1) ? (len & ~(SZ_64K - 1)) + SZ_64K : len;
- return sst26_lock_ctl(nor, ofs, len, SST26_CTL_CHECK);
+ return !sst26_lock_ctl(nor, ofs, len, SST26_CTL_CHECK);
}
static int sst_write_byteprogram(struct spi_nor *nor, loff_t to, size_t len,