]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: spi-nor: Fix the disabling of write protection at init
authorTudor Ambarus <tudor.ambarus@microchip.com>
Wed, 31 Jul 2019 08:46:16 +0000 (08:46 +0000)
committerRichard Weinberger <richard@nod.at>
Tue, 13 Aug 2019 12:34:42 +0000 (14:34 +0200)
commite832e5c82b766ff1486a77544d19f738b50e2727
treef3910fe2e377e8b5371d0fdf63c8c32196d50ff4
parenta2e8c383b17a2d6e840c741e443bf5c89e5e0a84
mtd: spi-nor: Fix the disabling of write protection at init

spi_nor_spansion_clear_sr_bp() depends on spansion_quad_enable().
While spansion_quad_enable() is selected as default when
initializing the flash parameters, the nor->quad_enable() method
can be overwritten later on when parsing BFPT.

Select the write protection disable mechanism at spi_nor_init() time,
when the nor->quad_enable() method is already known.

Fixes: aead9b55eb9290a2 ("mtd: spi-nor: use 16-bit WRR command when QE is set on spansion flashes")
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Reviewed-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
drivers/mtd/spi-nor/spi-nor.c