]> git.itanic.dy.fi Git - linux-stable/commit
spi: Fix error code checking in spi_mem_exec_op()
authorFlorian Fainelli <florian.fainelli@broadcom.com>
Wed, 13 Mar 2024 19:45:30 +0000 (12:45 -0700)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:17:33 +0000 (18:17 -0400)
commita1097308379f0a9a14a810b3db8b3fcc569c851f
tree610207760779703ca4ec96c412583d626d74611a
parentf9f2440523925d747e448ac7ed29525d9b640228
spi: Fix error code checking in spi_mem_exec_op()

[ Upstream commit 29895ce18311ddd702973ddb3a6c687db663e0fb ]

After commit cff49d58f57e ("spi: Unify error codes by replacing -ENOTSUPP with
-EOPNOTSUPP"), our SPI NOR flashes would stop probing with the following
visible in the kernel log:

[    2.196300] brcmstb_qspi f0440920.qspi: using bspi-mspi mode
[    2.210295] spi-nor: probe of spi1.0 failed with error -95

It turns out that the check in spi_mem_exec_op() was changed to check
for -ENOTSUPP (old error code) or -EOPNOTSUPP (new error code), but this
means that for drivers that were converted, the second condition is now
true, and we stop falling through like we used to. Fix the error to
check for neither error being neither -ENOTSUPP *nor* -EOPNOTSUPP.

Fixes: cff49d58f57e ("spi: Unify error codes by replacing -ENOTSUPP with -EOPNOTSUPP")
Reviewed-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Link: https://msgid.link/r/20240313194530.3150446-1-florian.fainelli@broadcom.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/spi/spi-mem.c