spi: stm32-qspi: Fix error path in case of -EPROBE_DEFER
authorPatrice Chotard <patrice.chotard@st.com>
Tue, 16 Jun 2020 11:30:35 +0000 (13:30 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 17 Jun 2020 12:26:41 +0000 (13:26 +0100)
commit35700e221b18fa53401e5f315be90af9e0bbcdca
tree3a1e068923f8f872a7a13674c906df4e0c775786
parent27784a256c2a453d891c0aaff84c3ac3f2e8a5a0
spi: stm32-qspi: Fix error path in case of -EPROBE_DEFER

In case of -EPROBE_DEFER, stm32_qspi_release() was called
in any case which unregistered driver from pm_runtime framework
even if it has not been registered yet to it. This leads to:

stm32-qspi 58003000.spi: can't setup spi0.0, status -13
spi_master spi0: spi_device register error /soc/spi@58003000/mx66l51235l@0
spi_master spi0: Failed to create SPI device for /soc/spi@58003000/mx66l51235l@0
stm32-qspi 58003000.spi: can't setup spi0.1, status -13
spi_master spi0: spi_device register error /soc/spi@58003000/mx66l51235l@1
spi_master spi0: Failed to create SPI device for /soc/spi@58003000/mx66l51235l@1

On v5.7 kernel,this issue was not "visible", qspi driver was probed
successfully.

Fixes: 9d282c17b023 ("spi: stm32-qspi: Add pm_runtime support")
Signed-off-by: Patrice Chotard <patrice.chotard@st.com>
Link: https://lore.kernel.org/r/20200616113035.4514-1-patrice.chotard@st.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-stm32-qspi.c