linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next] spi: stm32-ospi: Fix NULL vs IS_ERR() bug in stm32_ospi_get_resources()
@ 2025-07-15 23:01 Dan Carpenter
  2025-07-16 17:30 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-07-15 23:01 UTC (permalink / raw)
  To: Rob Herring
  Cc: Mark Brown, Maxime Coquelin, Alexandre Torgue, linux-spi,
	linux-stm32, linux-arm-kernel, linux-kernel, kernel-janitors

This code was changed from using devm_ioremap() which returns NULL to
using devm_ioremap_resource() which returns error pointers.  Update
the error checking to match.

Fixes: defe01abfb7f ("spi: stm32-ospi: Use of_reserved_mem_region_to_resource() for "memory-region"")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/spi/spi-stm32-ospi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-stm32-ospi.c b/drivers/spi/spi-stm32-ospi.c
index 72baa402a2c3..f36fd36da269 100644
--- a/drivers/spi/spi-stm32-ospi.c
+++ b/drivers/spi/spi-stm32-ospi.c
@@ -823,9 +823,9 @@ static int stm32_ospi_get_resources(struct platform_device *pdev)
 	if (!ret) {
 		ospi->mm_size = resource_size(res);
 		ospi->mm_base = devm_ioremap_resource(dev, res);
-		if (!ospi->mm_base) {
+		if (IS_ERR(ospi->mm_base)) {
 			dev_err(dev, "unable to map memory region: %pR\n", res);
-			ret = -ENOMEM;
+			ret = PTR_ERR(ospi->mm_base);
 			goto err_dma;
 		}
 
-- 
2.47.2



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

* Re: [PATCH next] spi: stm32-ospi: Fix NULL vs IS_ERR() bug in stm32_ospi_get_resources()
  2025-07-15 23:01 [PATCH next] spi: stm32-ospi: Fix NULL vs IS_ERR() bug in stm32_ospi_get_resources() Dan Carpenter
@ 2025-07-16 17:30 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2025-07-16 17:30 UTC (permalink / raw)
  To: Rob Herring, Dan Carpenter
  Cc: Maxime Coquelin, Alexandre Torgue, linux-spi, linux-stm32,
	linux-arm-kernel, linux-kernel, kernel-janitors

On Tue, 15 Jul 2025 18:01:39 -0500, Dan Carpenter wrote:
> This code was changed from using devm_ioremap() which returns NULL to
> using devm_ioremap_resource() which returns error pointers.  Update
> the error checking to match.
> 
> 

Applied to

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

Thanks!

[1/1] spi: stm32-ospi: Fix NULL vs IS_ERR() bug in stm32_ospi_get_resources()
      commit: 951a6d8d41289b86a564ee5563ededa702b62b1b

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] 2+ messages in thread

end of thread, other threads:[~2025-07-16 17:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15 23:01 [PATCH next] spi: stm32-ospi: Fix NULL vs IS_ERR() bug in stm32_ospi_get_resources() Dan Carpenter
2025-07-16 17:30 ` 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).