spi: stm32_qspi: Remove useless struct stm32_qspi_flash
authorPatrice Chotard <patrice.chotard@foss.st.com>
Mon, 3 Apr 2023 06:04:43 +0000 (08:04 +0200)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Wed, 19 Apr 2023 07:52:42 +0000 (09:52 +0200)
commitacf9f03634c472041dd2f4a5d7fa5c9b0d0b081d
tree8d3145e3cc1cc4db3058af3b10de53acf39e7cd3
parent60edabc0a38e9f5ee0d84dad19710873fabac5e7
spi: stm32_qspi: Remove useless struct stm32_qspi_flash

Currently, in stm32_qspi_claim_bus(), QSPI_CR and QSPI_DCR registers
are saved in stm32_ospi_flash struct on first flash memory initialization
and restored on each flash accesses.

As the logic of spi-uclass.c changed since 'commit 741280e9accd
("spi: spi-uclass: Fix spi_claim_bus() speed/mode setup logic")'
set_speed() and set_mode() callbacks are called systematically when bus
speed or bus mode need to be updated, QSPI_CR and QSPI_DCR registers are
set accordingly.

So stm32_qspi_claim_bus() can be updated by removing QSPI_CR and QSPI_DCR
save/restore code and struct stm32_ospi_flash can be removed as well.

Signed-off-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
drivers/spi/stm32_qspi.c