[PATCH 3/3] spi: bcm-qspi: return error from failed controller suspend

From: Jiawen Liu

Date: Thu Jun 18 2026 - 12:46:20 EST


spi_controller_suspend() can fail if the SPI core cannot stop the
controller. bcm_qspi_suspend() ignored that error, disabled the
controller clock, uninitialized the hardware, and returned success.

Return the suspend error before tearing down the clock and hardware
state.

Signed-off-by: Jiawen Liu <1298662399@xxxxxx>
---
drivers/spi/spi-bcm-qspi.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-bcm-qspi.c b/drivers/spi/spi-bcm-qspi.c
index dcade7b99cef..ae1ffe13fa46 100644
--- a/drivers/spi/spi-bcm-qspi.c
+++ b/drivers/spi/spi-bcm-qspi.c
@@ -1692,13 +1692,17 @@ EXPORT_SYMBOL_GPL(bcm_qspi_remove);
static int __maybe_unused bcm_qspi_suspend(struct device *dev)
{
struct bcm_qspi *qspi = dev_get_drvdata(dev);
+ int ret;

/* store the override strap value */
if (!bcm_qspi_bspi_ver_three(qspi))
qspi->s3_strap_override_ctrl =
bcm_qspi_read(qspi, BSPI, BSPI_STRAP_OVERRIDE_CTRL);

- spi_controller_suspend(qspi->host);
+ ret = spi_controller_suspend(qspi->host);
+ if (ret)
+ return ret;
+
clk_disable_unprepare(qspi->clk);
bcm_qspi_hw_uninit(qspi);

--
2.34.1