linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next] spi: stm32-ospi: clean up on error in probe()
@ 2025-06-11 13:09 Dan Carpenter
  2025-06-12  9:10 ` Patrice CHOTARD
  2025-06-12 12:33 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2025-06-11 13:09 UTC (permalink / raw)
  To: Patrice Chotard
  Cc: Mark Brown, Maxime Coquelin, Alexandre Torgue, Philipp Zabel,
	linux-spi, linux-stm32, linux-arm-kernel, linux-kernel,
	kernel-janitors

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@linaro.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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH next] spi: stm32-ospi: clean up on error in probe()
  2025-06-11 13:09 [PATCH next] spi: stm32-ospi: clean up on error in probe() Dan Carpenter
@ 2025-06-12  9:10 ` Patrice CHOTARD
  2025-06-12 12:33 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Patrice CHOTARD @ 2025-06-12  9:10 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Mark Brown, Maxime Coquelin, Alexandre Torgue, Philipp Zabel,
	linux-spi, linux-stm32, linux-arm-kernel, linux-kernel,
	kernel-janitors



On 6/11/25 15:09, Dan Carpenter wrote:
> 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@linaro.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);


Hi Dan

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH next] spi: stm32-ospi: clean up on error in probe()
  2025-06-11 13:09 [PATCH next] spi: stm32-ospi: clean up on error in probe() Dan Carpenter
  2025-06-12  9:10 ` Patrice CHOTARD
@ 2025-06-12 12:33 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2025-06-12 12:33 UTC (permalink / raw)
  To: Patrice Chotard, Dan Carpenter
  Cc: Maxime Coquelin, Alexandre Torgue, Philipp Zabel, linux-spi,
	linux-stm32, linux-arm-kernel, linux-kernel, kernel-janitors

On Wed, 11 Jun 2025 16:09:45 +0300, Dan Carpenter wrote:
> If reset_control_acquire() fails, then we can't return directly.
> We need to do a little clean up first.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: stm32-ospi: clean up on error in probe()
      commit: 83f066fac3c231e58e9adf3b307e96fee172dfb3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-06-12 13:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-11 13:09 [PATCH next] spi: stm32-ospi: clean up on error in probe() Dan Carpenter
2025-06-12  9:10 ` Patrice CHOTARD
2025-06-12 12:33 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).