mtd: spi-nor: spansion: Rework spi_nor_cypress_octal_dtr_enable()
authorTudor Ambarus <tudor.ambarus@microchip.com>
Wed, 20 Apr 2022 10:34:24 +0000 (13:34 +0300)
committerPratyush Yadav <p.yadav@ti.com>
Wed, 27 Apr 2022 09:27:36 +0000 (14:57 +0530)
commit27ff0d34fb7e4c2a37c724d5c5ca8209c8bb5723
tree818017f9b2009aef0a75c3e641ba474bd2e3c062
parent4629adaff7bca453757f4df235e533ad460baa28
mtd: spi-nor: spansion: Rework spi_nor_cypress_octal_dtr_enable()

Introduce template operation to remove code duplication.
Split spi_nor_cypress_octal_dtr_enable() in
spi_nor_cypress_octal_dtr_ena() spi_nor_cypress_octal_dtr_dis() as it no
longer made sense to try to keep everything alltogether: too many
"if (enable)" throughout the code, which made the code difficult to read.
Add debug messages in case spi_nor_read_id() fails.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
Reviewed-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220420103427.47867-9-tudor.ambarus@microchip.com
drivers/mtd/spi-nor/spansion.c