mtd: spi-nor: Check bus width while setting QE bit
authorHsin-Yi Wang <hsinyi@chromium.org>
Fri, 18 Aug 2023 06:42:23 +0000 (14:42 +0800)
committerTudor Ambarus <tudor.ambarus@linaro.org>
Fri, 18 Aug 2023 09:54:52 +0000 (12:54 +0300)
commitf01d8155a92e33cdaa85d20bfbe6c441907b3c1f
treeef27b9cdd37d28a2938cfa88288122a26ae32e7d
parentaa517a29d6457e8afcbe8e7e9eb8813594c39d1f
mtd: spi-nor: Check bus width while setting QE bit

spi_nor_write_16bit_sr_and_check() should also check if bus width is
4 before setting QE bit.

Fixes: 39d1e3340c73 ("mtd: spi-nor: Fix clearing of QE bit on lock()/unlock()")
Suggested-by: Michael Walle <michael@walle.cc>
Suggested-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org>
Reviewed-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20230818064524.1229100-2-hsinyi@chromium.org
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
drivers/mtd/spi-nor/core.c