[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEmAGTUzzKZlLe3K@stanley.mountain>
Date: Wed, 11 Jun 2025 16:09:45 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Patrice Chotard <patrice.chotard@...s.st.com>
Cc: Mark Brown <broonie@...nel.org>,
Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Philipp Zabel <p.zabel@...gutronix.de>, linux-spi@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH next] spi: stm32-ospi: clean up on error in probe()
If reset_control_acquire() fails, then we can't return directly.
We need to do a little clean up first.
Fixes: cf2c3eceb757 ("spi: stm32-ospi: Make usage of reset_control_acquire/release() API")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
drivers/spi/spi-stm32-ospi.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-stm32-ospi.c b/drivers/spi/spi-stm32-ospi.c
index db6b1cfc970f..4ab7e86f4bd5 100644
--- a/drivers/spi/spi-stm32-ospi.c
+++ b/drivers/spi/spi-stm32-ospi.c
@@ -937,8 +937,10 @@ static int stm32_ospi_probe(struct platform_device *pdev)
goto err_pm_enable;
ret = reset_control_acquire(ospi->rstc);
- if (ret)
- return dev_err_probe(dev, ret, "Can not acquire reset %d\n", ret);
+ if (ret) {
+ dev_err_probe(dev, ret, "Can not acquire reset %d\n", ret);
+ goto err_pm_resume;
+ }
reset_control_assert(ospi->rstc);
udelay(2);
--
2.47.2
Powered by blists - more mailing lists