mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
spi: bcm-qspi: return error from failed controller suspend
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@qq.com> Reviewed-by: Kamal Dasu <kamal.dasu@broadcom.com> Link: https://patch.msgid.link/tencent_21BF5F9512F56D45FD9018BAF14ED2805808@qq.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user